Skip to content

Instantly share code, notes, and snippets.

View alameenkhader's full-sized avatar

Al Ameen Khader alameenkhader

  • Vista, California
View GitHub Profile

Undo a local merge (not comited/pushed yet)
git reset --hard <last-commit-id>
Above command will move to the state of the last commit, ignoring all the changes.

If you want to push after a hard reset, use -f option
git push origin <branch-name> -f

To checkout by folder
git checkout master -- db/migrate

@alameenkhader
alameenkhader / rpush-monit.md
Created July 21, 2015 11:34
rpush-monit.md
@alameenkhader
alameenkhader / rails-rpush.md
Last active August 28, 2020 09:10
Rpush/Rails Integration

###rpush - https://github.com/rpush/rpush

Follow the steps in rpush to add the gem to your rails project

####PushNotificationDevice

rails g model PushNotificationDevice device_type:integer:index device_token:string
class CreatePushNotificationDevices < ActiveRecord::Migration
@alameenkhader
alameenkhader / rspec-remember.md
Last active October 7, 2015 12:51
More - Rspec
@alameenkhader
alameenkhader / cordova-android-sdk-setup
Created October 24, 2014 12:51
cordova-android-sdk-setup
install android sdk
download android sdk alone
unzip it
move a safe folder(remember the path)
set the ANDROID_HOME
export ANDROID_HOME=/home/user/android-sdk-linux
export ANDROID_HOME=~/android-sdk-linux
export PATH=$ANDROID_HOME/tools:$PATH
export PATH=$ANDROID_HOME/platform-tools:$PATH
@alameenkhader
alameenkhader / postgres-basics.md
Last active September 23, 2016 12:12
postgres - installation and basics

####Install the whole package
sudo apt-get install postgresql postgresql-contrib ####Install pgAdmin III - a handy GUI for PostgreSQL
sudo apt-get install pgadmin3

####Setup
#####Login to postgres sql prompt
sudo -u postgres psql postgres
#####Change the postgres user password
\password postgres

@alameenkhader
alameenkhader / bootstrap-w-rails.md
Last active August 29, 2015 14:06
Rails with bootstrap
  • Download bootstrap
  • Add bootstrap.js to vendor/assets/javascripts
  1. Add the following to app/assets/application.js
    //= require bootstrap
  2. Add bootstrap.css to vendor/assets/stylesheets
  3. Add the following to app/assets/application.css
    *= require bootstrap
  4. Add fonts to vendor/assets/fonts folder
  5. Add this to config/initializers/assets.rb
    config.assets.paths << "#{Rails}/vendor/assets/fonts"
@alameenkhader
alameenkhader / sublime-all-you-want.md
Last active October 4, 2018 06:17
Sublime - All you want
@alameenkhader
alameenkhader / visudo-user-access
Created February 20, 2014 12:21
How to add sudo permission to a particular command for a user
How to add sudo permission to a particular command for a user
Following example illustrates how to add apache restart access to the user nih
Login as root user
Then open visudo by typing in
visudo
Add the command to the end of the file
#username# ALL= NOPASSWD: #command#
nih ALL= NOPASSWD: /etc/init.d/httpd restart
[
{
name: "Alabama",
abbreviation: "AL"
},
{
name: "Alaska",
abbreviation: "AK"
},
{