Skip to content

Instantly share code, notes, and snippets.

View mraaroncruz's full-sized avatar
🏃‍♂️

Aaron Cruz mraaroncruz

🏃‍♂️
View GitHub Profile
@mraaroncruz
mraaroncruz / description.md
Created October 8, 2012 09:45
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
@leucos
leucos / README.md
Last active December 11, 2015 10:28
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
adonaldson / users_helper.rb
Created January 26, 2013 07:55
Example of a gravatar helper method for Rails (3)
# 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
@darkwookiee
darkwookiee / SendListToOmni.py
Created January 24, 2013 18:17
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
remy / stunnel-rapidssl-howto.md
Last active December 17, 2015 03:49
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 headshots.leftlogic.com.key -out headshots.leftlogic.com.csr

Ensure the "common name" is the host you want to assign the certificate to (in my case it was headshots.leftlogic.com).

Paste the contents of the .csr file in to the .csr field in namecheap.com. 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:

anonymous
anonymous / gist:6249142
Created August 16, 2013 11:35
#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
mraaroncruz / angular_templates_controller.rb
Last active December 21, 2015 12:19
A rails controller to deal with angular templates.
# 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
xaviershay / build_frontend.sh
Last active December 24, 2015 20:49
SASS + Coffee + Concatenation in prod
#!/bin/bash
set -exo pipefail
BUILD_ENV=$1
if [ `uname` == 'Darwin' ]; then
OSX=1
JSCOMPRESSOR="yuicompressor --type js"
else
OSX=
@octplane
octplane / polycorn.md
Last active December 25, 2015 21:08
Life and Death of Unicorns The introduction of our Unicorn management tool, Polycorn. This gists contains the original article about Polycorn plus the source code of Polycorn.

Life and death of Unicorns

The introduction of our Unicorn management tool, Polycorn.

jump into our train!

Photo by Protohiro from Flickr

At Fotopedia, we use Unicorn to serve our main Rails application. Every day, we restart our application several times, spawning and killing hundred of Unicorns. Managing graceful restarts is a complex task, and requires careful monitoring and command. This article introduces our tool Polycorn, a Unicorn management program.

[[MORE]]

@mraaroncruz
mraaroncruz / Gruntfile.coffee
Last active January 2, 2016 19:29
Gruntfile.js with proxy settings
# Generated on 2014-01-15 using generator-angular 0.7.1
"use strict"
# # Globbing
# for performance reasons we're only matching one level down:
# 'test/spec/{,*/}*.js'
# use this if you want to recursively match all subfolders:
# 'test/spec/**/*.js'
module.exports = (grunt) ->