Skip to content

Instantly share code, notes, and snippets.

@sagmor
sagmor / Capfile
Created November 28, 2009 20:11
Cake PHP Capfile example
load 'deploy' if respond_to?(:namespace) # cap2 differentiator
load 'app/config/deploy'
namespace :deploy do
task :restart do
# How to restart Your Server
end
task :finalize_update do
['secret','database'].each do |config|
#! /bin/sh
# start / stop script for mongodb
### BEGIN INIT INFO
# Provides: mongod
# Required-Start: \$remote_fs \$syslog
# Required-Stop: \$remote_fs \$syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
<VirtualHost *:80>
ServerName osiris.firenxis.com
DocumentRoot /var/www/datatube/current/public
<Directory /var/www/datatube/current/public>
AllowOverride all
Options -MultiViews
</Directory>
</VirtualHost>
@sagmor
sagmor / gist:1041943
Created June 23, 2011 05:12
Patched Ruby 1.9.2 for faster load and GC
# Ruby 1.9 Fast require:
# https://gist.github.com/1008945
curl https://raw.github.com/gist/1008945/7532898172cd9f03b4c0d0db145bc2440dcbb2f6/load.patch > load.patch
# Ruby 1.9.2 GC Patch:
# https://gist.github.com/856296
curl https://raw.github.com/gist/856296/a19ac26fe7412ef398bd9f57e61f06fef1f186fe/patch-1.9.2-gc.patch > gc.patch
rvm install 1.9.2-p180 --patch load.patch,gc.patch
rm gc.patch load.patch
@sagmor
sagmor / gist:1076336
Created July 11, 2011 17:29
How to upgrade Fail Fast
# Descargar el código
git clone git@github.com:ChileAgil/shapado.git
cd shapado
# Agregar repositorio oficial
git remote add upstream git://github.com/ricodigo/shapado.git
# Descargar última versión de Shapado
git pull upstream master
git push origin master
@sagmor
sagmor / app_config.rb
Created July 21, 2011 23:00
Get an AppConfig file in your app
# This goes to Rails.root/lib
# Requires the hashie gem
::AppConfig = begin
config_file = File.expand_path('../../config/config.yml', __FILE__)
config = Hashie::Mash.new YAML.load_file( config_file )[ Rails.env ]
local_config_file = File.expand_path('../../config/config.local.yml', __FILE__)
if File.exists? local_config_file
config.merge! YAML.load_file( local_config_file )[ Rails.env ] || {}
@sagmor
sagmor / gist:1174827
Created August 27, 2011 01:17
Some minor hacks for console.fm on fluid
// ==UserScript==
// @name Console Hacks
// @description Some minor hacks for console.fm
// @include http://*console.fm/*
var lastFm = {
enabled: false,
key: "APIKEY",
secret: "SECRETKEY",
session: "SESSIONKEY"
@sagmor
sagmor / working.m
Created April 12, 2012 22:52
Zebra Print Test
// This one gets locked
+ (void)print1WithAddress:(NSString *)printerAddress andPort:(NSInteger)printerPort
{
NSError *error = nil;
TcpPrinterConnection *connection = [[TcpPrinterConnection alloc] initWithAddress:printerAddress andWithPort:printerPort];
[connection open];
NSString *file =
@sagmor
sagmor / 0-README.md
Last active October 7, 2015 01:38
Machine Bootstrap

Machine Bootstrap

The idea of this gist is to document all the needed steps to setup a working machine with all the stuff that I need during development.

Requirements

Command Line Tools for Xcode: Download them from XCode or directly from https://developer.apple.com/downloads

@sagmor
sagmor / 1-freeswitch.sh
Created September 6, 2013 22:44
WIP: Freeswitch and Adhearsion Debian/Ubuntu Setup
###
# Install Freeswitch on Debian/Ubuntu
# Mostly taken from http://robbietilton.com/blog/?p=1057
apt-get install git-core build-essential autoconf automake libtool libncurses5 libncurses5-dev gawk libjpeg-dev libz-dev pkg-config<
cd /usr/local/src
git clone git://git.freeswitch.org/freeswitch.git
cd freeswitch