Skip to content

Instantly share code, notes, and snippets.

View adg29's full-sized avatar
📱

Alan Garcia adg29

📱
View GitHub Profile
@adg29
adg29 / Gemfile
Created December 8, 2012 22:58 — forked from gorenje/Gemfile
An example sinatra omniauth client app
source :rubygems
gem 'sinatra'
gem 'json'
gem 'omniauth'
gem 'omniauth-oauth2'
gem 'omniauth-github'
gem 'omniauth-facebook'
gem 'omniauth-twitter'
# gem 'omniauth-att', :path => File.expand_path("./../../omniauth-att", __FILE__)
@adg29
adg29 / _.md
Created December 9, 2012 17:26
Venn Diagrams
@adg29
adg29 / gist:4254440
Created December 10, 2012 23:47 — forked from hzlzh/gist:3128038
console.log() snippet for Sublime Text 2
<snippet>
<!-- put this file in /packages/User/<Folder Name>/console_log.sublime-snippet then restart your Sublime Text 2 -->
<content><![CDATA[console.log($1);$0]]></content>
<tabTrigger>conl</tabTrigger>
<scope>text.html,source.js</scope>
<description>console.log()</description>
</snippet>
<snippet>
<!-- put this in another file /packages/User/<Folder Name>/console_dir.sublime-snippet then restart your Sublime Text 2 -->
@adg29
adg29 / README.md
Last active April 27, 2017 18:00 — forked from mbostock/.block
County Circles

This symbol map encodes the area of each county using a circle at the county's centroid.

@adg29
adg29 / README.md
Last active April 27, 2017 17:59 — forked from sxv/README.md
Interactive SVG + Canvas + Div Plot

Another take on the SVG + Canvas Plot, but this time includes a third group of nodes: divs. Black nodes are drawn with HTML5 Canvas, blue nodes in SVG, and red nodes as divs. Zoomable and pannable.

@adg29
adg29 / README.md
Last active April 27, 2017 17:58 — forked from simenbrekken/README.md
Simple Backbone + Express + MongoDB REST backend application

Requirements:

If you're on OSX you're probably best off using Homebrew to install this stuff:

$ brew install node mongodb

Usage:

_.mixin({
renameProperties: function (object, translations) {
_.each(_.pairs(translations), function(translation) {
_.each(object, function(item){
if (item.hasOwnProperty(translation[0])) {
item[translation[1]] = item[translation[0]];
delete item[translation[0]];
}
});
});
@adg29
adg29 / pr.md
Created April 22, 2013 20:26 — forked from piscisaureus/pr.md

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

class Api::RegistrationsController < Api::BaseController
respond_to :json
def create
user = User.new(params[:user])
if user.save
render :json=> user.as_json(:auth_token=>user.authentication_token, :email=>user.email), :status=>201
return
else