Skip to content

Instantly share code, notes, and snippets.

View alameenkhader's full-sized avatar

Al Ameen Khader alameenkhader

  • Vista, California
View GitHub Profile
{"lastUpload":"2019-09-30T06:02:30.812Z","extensionVersion":"v3.4.3"}
@alameenkhader
alameenkhader / helpers.css.scss
Created January 23, 2016 12:56
Helper css classess
.bg-white {
background-color: #ffffff;
color: black;
}
.bg-none {
background-color: transparent;
}
.btn-center {
@alameenkhader
alameenkhader / devise-angular-sign-in.md
Created October 9, 2015 10:41
Devise Ajax Sign in with Angular JS

app/controllers/sessions_controller.rb

#
# SessionsController - Controller for user session
#
# @author alameen
#
class SessionsController < Devise::SessionsController
  def create
    resource = warden.authenticate!(scope: resource_name,

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 / ubuntu-services.md
Last active September 10, 2015 06:10
Ubuntu Services | Start Up Scripts

###How to enable a service

As an example, to enable Apache web server in Debian, do the following -
update-rc.d apache2 defaults

... this will enable the Apache web server to start in the default run levels of 2,3,4 and 5. Of course, you can do it explicitly by giving the run levels instead of the defaults keyword as follows:
update-rc.d apache2 start 20 2 3 4 5 . stop 80 0 1 6 .

The above command modifies the sym-links in the respective /etc/rcX.d directories to start or stop the service in the destined runlevels. Here X stands for a value of 0 to 6 depending on the runlevel. One thing to note here is the dot (.) which is used to terminate the set which is important. Also 20 and 80 are the sequence codes which decides in what order of precedence the scripts in the /etc/init.d/ directory should be started or stopped.

@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