Creating a `Users` show page using Devise

You should generate a users_controller which inherits from application_controller and define there your custom show method. Don’t forget to create a view and routes for it. Ex: #users_controller.rb def show @user = User.find(params[:id]) end #in your view <%= @user.name %> #routes.rb match ‘users/:id’ => ‘users#show’, via: :get # or get ‘users/:id’ => ‘users#show’ # or … Read more

How to “git show” the diffs for a merge commit?

Use one of the following: git show -m c05f017 git show –first-parent c05f017 git diff c05f017^ c05f017 There’s a fundamental error in your question: commits are not diffs; commits are snapshots. This might seem like a distinction without a difference—and for some commits, it is. But for merge commits, it’s not. When git show (or … Read more

jQuery show for 5 seconds then hide

You can use .delay() before an animation, like this: $(“#myElem”).show().delay(5000).fadeOut(); If it’s not an animation, use setTimeout() directly, like this: $(“#myElem”).show(); setTimeout(function() { $(“#myElem”).hide(); }, 5000); You do the second because .hide() wouldn’t normally be on the animation (fx) queue without a duration, it’s just an instant effect. Or, another option is to use .delay() … Read more

Hide/Show Column in a HTML Table

One line of code using jQuery which hides the 2nd column: $(‘td:nth-child(2)’).hide(); If your table has header(th), use this: $(‘td:nth-child(2),th:nth-child(2)’).hide(); Source: Hide a Table Column with a Single line of jQuery code jsFiddle to test the code: http://jsfiddle.net/mgMem/1/ If you want to see a good use case, take a look at my blog post: Hide … Read more

Android – Programmatically Hide/Show Soft Keyboard [duplicate]

UPDATE 2 @Override protected void onResume() { super.onResume(); mUserNameEdit.requestFocus(); mUserNameEdit.postDelayed(new Runnable() { @Override public void run() { // TODO Auto-generated method stub InputMethodManager keyboard = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); keyboard.showSoftInput(mUserNameEdit, 0); } },200); //use 300 to make it run when coming back from lock screen } I tried very hard and found out a solution … whenever … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)