Skip to content

Instantly share code, notes, and snippets.


Aaron Cruz mraaroncruz

View GitHub Profile
mraaroncruz /
Created Oct 8, 2012
granadajs Hacknight Uno

Granadajs Hacknight Uno

Ideas for app

  • Shopping - a shopping list app, maybe with phonegap. Web/phone sync.
  • Tapatracker - categorize, describe, photos?, location tapa tracker. "Do I want asian noodles or oxtail? I'll check tapatracker!"
  • Unlikeable - a facebook app that checks which of your friends liked things that you disliked. I don't know if this is possible. It probably is.
  • SoundCloud playlist creator
collegeman /
Created Mar 9, 2011
Turn an Ubuntu 10.04 linode into a StatsD/Graphite server
# install git
sudo apt-get install g++ curl libssl-dev apache2-utils
sudo apt-get install git-core
# download the Node source, compile and install it
git clone
cd node
sudo make install
# install the Node package manager for later use
leucos /
Last active Dec 11, 2015
Ruby playbook example

Deploying Ruby with Ansible

Define these variables somewhere and let it go :

  • ruby_current: the ruby version you want to deploy (e.g. "1.9.3-p374")
  • ruby_user: Under which account we want ruby to be installed (e.g. "myappuser"; "ruby" in this playbook)

Note : this playbook only works with '-i' in the sudo line since it requires the target user environment to be fully loaded

adonaldson / users_helper.rb
Created Jan 26, 2013
Example of a gravatar helper method for Rails (3)
View users_helper.rb
# Assumes two things
# i) Your user class's to_s method outputs something useful - perhaps their name or email address
# ii) Your user class has an 'email' attribute
# This will work with any ruby class, it doesn't have to be an activerecord model
# usage: gravatar_tag(my_user, size: '32x32', alt: 'This is the alt text', title: 'Any other options get passed into image_tag')
module UsersHelper
View 20130211233909_create_bookmarks.rb
class CreateBookmarks < ActiveRecord::Migration
def change
create_table :bookmarks do |t|
t.integer :user_id
t.string :title
t.string :description
t.string :sku
t.integer :number
t.integer :timestamp
t.boolean :global
darkwookiee /
Created Jan 24, 2013
This Script run in pythonista on iOS. It take a plain liste, in the clipboard, and for each item in the list, create a task in Omnifocus. This ia not optimal, since Omnifocus doesn'n seem to provide a x-callback-url. Pythonista need to be reopen each time.
#Import into Omnifocus a list of task from the clipboard
import clipboard
import re
import webbrowser
import urllib
import console
base = 'omnifocus:///add?name='
text = clipboard.get()
remy /
Last active Dec 17, 2015
A walk through for me, on how to configure a server with SSL using RapidSSL and stunnel

Generate .csr and .key file

openssl req -new -newkey rsa:2048 -nodes -keyout -out

Ensure the "common name" is the host you want to assign the certificate to (in my case it was

Paste the contents of the .csr file in to the .csr field in Follow the authorisation emails from RapidSSL

Create the .crt file by combining the web server certificate and the imtermediate CA from RapidSSL (I've used cat), so the file looks like this:

View gist:6249142
#created by @nthgergo
set :application, "APPLICATION_NAME"
set :scm, :git
set :repository, "GIT_URL"
set :user, "ec2-user"
set :ssh_options, { :forward_agent => true }
default_run_options[:pty] = true
set :use_sudo, false
set :branch, "master"
mraaroncruz / angular_templates_controller.rb
Last active Dec 21, 2015
A rails controller to deal with angular templates.
View angular_templates_controller.rb
# Just put your erb, haml, slim, etc. templates in app/views/angular_templates/my_template_name.
# For example your templatePath could be `articles/show` and your template
# would be app/views/angular_templates/articles/show.html.erb
class AngularTemplatesController < ApplicationController
def show
path = params[:template_path]
template_dir = File.join(Rails.root, "app", "views", "angular_templates")
templates = Dir.glob("#{template_dir}/**/*").map { |file|
file.sub(/.*?\/angular_templates\/(.+)\.html\.slim/, '\1')
xaviershay /
Last active Dec 24, 2015
SASS + Coffee + Concatenation in prod
set -exo pipefail
if [ `uname` == 'Darwin' ]; then
JSCOMPRESSOR="yuicompressor --type js"