Skip to content

Instantly share code, notes, and snippets.

View ravidsrk's full-sized avatar
🎯
Focusing

Ravindra Kumar ravidsrk

🎯
Focusing
View GitHub Profile
@sunnyluthra
sunnyluthra / git_shortcuts
Created January 31, 2014 05:45
Git Shortcuts to make life little bit easier
# Git shortcuts
alias g='git'
function ga() { git add "${@:-.}"; } # Add all files by default
alias gp='git push'
alias gpa='gp --all'
alias gu='git pull'
alias gl='git log'
alias gg='gl --decorate --oneline --graph --date-order --all'
alias gs='git status'
import java.util.concurrent.Callable
import com.android.build.gradle.BasePlugin
import java.util.regex.Pattern
apply plugin: 'android'
apply plugin: RobolectricPlugin
class RobolectricPlugin implements Plugin<Project> {
public static final String ANDROID_PLUGIN_NAME = "android";
package com.facebook.rebound.origami;
import android.app.Activity;
import android.content.res.Resources;
import android.os.Bundle;
import android.view.View;
import android.view.ViewTreeObserver;
import com.facebook.rebound.SimpleSpringListener;
import com.facebook.rebound.Spring;
@mkuprionis
mkuprionis / BrandListFragment.java
Created October 10, 2014 13:52
List view with sticky headers and filtering
public class BrandListFragment extends BaseFragment {
private static final String ARGS_LOCATION_SPEC = "location_spec";
private LocationSpec location;
@InjectView(R.id.progress) View progress;
@InjectView(R.id.brand_list) StickyListHeadersListView brandList;
@hanih
hanih / gist:16cf2468825bbe4e27f3
Last active August 29, 2015 14:11
Simple Titanium Studio plugin that creates a notification with sound in Notifications Center when build is finished
/*
Simple Titanium Studio plugin that creates a notification with sound in Notifications Center
when build is finished
In the project directory create a folder plugins/io.wlm.notifier/1.0/hooks and copy this file inside.
The name of the js file is not important, you can also change the plugin name to whatever you want.
Install npm module node-notifier https://github.com/mikaelbr/node-notifier
or download it and copy it inside a node_modules folder at the same level as this file.
In Tiapp.xml add a reference to the plugin like
<plugins>
@bernardeli
bernardeli / callback.rb
Created August 17, 2011 02:59
facebook + devise
class Users::OmniauthCallbacksController < Devise::OmniauthCallbacksController
def facebook
# You need to implement the method below in your model
@user = User.find_for_facebook_oauth(env["omniauth.auth"], current_user)
if @user.persisted?
flash[:notice] = I18n.t "devise.omniauth_callbacks.success", :kind => "Facebook"
sign_in_and_redirect @user, :event => :authentication
else
session["devise.facebook_data"] = env["omniauth.auth"]
@DmitrySoshnikov
DmitrySoshnikov / doc.js
Created September 1, 2011 18:22
Runtime documentation for function declarations
/**
* Simple doc-property generator. Uses JavaDoc style comments.
* Also provides type checking guards.
*
* Dependencies: SpiderMonkey >= 1.7
*
* by Dmitry Soshnikov <dmitry.soshnikov@gmail.com>
* MIT Style License
*/
@jetspeed
jetspeed / tpl-basicapp.rb
Created November 8, 2011 05:11 — forked from davidrichards/tpl-basicapp.rb
Rails 3, RSpec, Factory_Girl, HAML, SASS, Devise, JQuery, Backbone.js, jammit, haml.js
## Rails App Template
## Useful for Rails 3.0.x and Ruby 1.9.2
## Run using $ rails new [appname] -JT -m tpl-basicapp.rb
# ========
# = Gems =
# ========
# pre-install spork, dydram and elastic_searchable
run "gem install spork -v 0.9.0.rc --pre"
function setSeat(e, handler) {
e.preventDefault();
var seat = $(e.target)
$('.selected').removeClass('selected').click(handler);
seat.unbind('click', handler);
$('#seatSelected').text(seat.data('seat'));
@headius
headius / gist:1493911
Created December 18, 2011 16:53
Latest red/black tree benchmark results on Java 7, with and without invokedynamic
system ~/projects/jruby $ jruby -v bench/bench_red_black.rb
jruby 1.7.0.dev (ruby-1.8.7-p352) (2011-12-18 43cbc21) (Java HotSpot(TM) 64-Bit Server VM 1.6.0_29) [darwin-x86_64-java]
2.748
1.902
1.87
1.877
1.873
1.868
1.864
1.876