Skip to content

Instantly share code, notes, and snippets.

(function(ctx, $, undefined){
$(document).ready(function(){
bindEvent();
})
function bindEvent () {
//private scope for application
}
@eliza-abraham
eliza-abraham / Preferences.sublime.settings
Last active July 14, 2017 07:23
Sublime Preferences
{
"color_scheme": "Packages/User/Twilight (SL).tmTheme",
"font_size": 10,
"ignored_packages":
[
"Vintage"
],
"rulers":
[
80
class BaseCreator < Creators::Base
EXTRA_PARAMS = [:action, :controller, :format,:utf8,:authenticity_token]
def initialize(raw_params, model)
super(raw_params,model)
end
def refine_params
@params.deep_symbolize_keys.delete_if{|k,v| EXTRA_PARAMS.include? k }
#!/usr/bin/env xdg-open
[Desktop Entry]
Version=1.0
Type=Application
Name=Sublime Text
GenericName=Text Editor
Comment=Sophisticated text editor for code, markup and prose
Exec=/opt/sublime_text_3/sublime_text %F
Icon=/opt/sublime_text_3/Icon/48x48/sublime-text.png
Terminal=false
@eliza-abraham
eliza-abraham / revert_commits
Created April 25, 2014 10:18
Reverting Commits
Clean way to revert a commit by also leaving a log of the revert
$ git revert --strategy resolve <commit>
# To get parameters from your controller inside your transition callback
# transition : cannot be changed to a different variable name. It should always be transition
# my_model : will always have the current object of the model class in which your state machine is defined
# can add any variable name
# params : Actual parameters are stored in transition.args which is an array of parameters passed
class MyModel
def update_my_model
@eliza-abraham
eliza-abraham / merging_commits
Created March 25, 2014 10:23
Merge Two Commits
$ git log
commit c
Added algorithms for Cosine-similarity
commit b
Set stage for similar objects
commit a
Fixed a bug in space world automation
@eliza-abraham
eliza-abraham / new_remote_branch
Last active August 29, 2015 13:55
Pull From New Remote Branch
$ git fetch origin
Fetches all the remote branches from origin.
$ git checkout --track origin/<remote_branch_name>
This will create a local branch that tracks a remote branch. This command will create the local branch specified in <remote_branch_name>, track the remote branch origin/<remote_branch_name>.
@eliza-abraham
eliza-abraham / Overriding Active Admin
Last active January 4, 2016 21:59
Overriding Active Admin
# Breadcrumbs
## Remove breadcrumbs for all pages of a particular Model
config.breadcrumb = Proc.new{ [] }
# Filters
## Search for multiple columns
filter :first_name_or_last_name