Skip to content

Instantly share code, notes, and snippets.

View PabloC's full-sized avatar

PabloC PabloC

View GitHub Profile
@PabloC
PabloC / gist:5274647
Last active December 15, 2015 14:29
discourse.pill
rails_env = ENV['RAILS_ENV'] || "production"
rails_root = ENV['RAILS_ROOT'] || "/var/www/discourse"
user = ENV["DISCOURSE_USER"] || ENV['USER'] || 'user_running_app'
group = ENV["DISCOURSE_GROUP"] || ENV['GROUP'] || 'www-data'
num_webs = ENV["NUM_WEBS"].to_i > 0 ? ENV["NUM_WEBS"].to_i : 4
# to debug use
#Bluepill.application("your_app", :foreground => true) do |app|
Bluepill.application("discourse") do |app|
#!/bin/sh
# Author: Carl Youngblood, 2010
# Based on http://www.novell.com/coolsolutions/feature/15380.html
### BEGIN INIT INFO
# Provides: bluepill
# Required-Start:
# Required-Stop:
# Default-Start: 2 3 4 5
afsdfdsfsj lkjf safasdf
sdfklsjafsdf
safloremq
@PabloC
PabloC / hack.sh
Created March 31, 2012 15:33 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@PabloC
PabloC / config.js
Created July 28, 2010 18:37 — forked from eric1234/config.js
Es Cool, un editor simil al de basecamp
CKEDITOR.lang.load('en', 'en', function() {
CKEDITOR.lang['en']['numberedlist'] = 'Numbers';
CKEDITOR.lang['en']['bulletedlist'] = 'Bullets';
CKEDITOR.replace('project_description', {
toolbar: [['Bold', 'Italic', '-', 'NumberedList', 'BulletedList']],
toolbarCanCollapse: false,
resize_enabled: false,
customConfig: '',
removePlugins: 'elementspath'
});
STDOUT.sync = true
require 'queue'
start_time = Time.now.to_i
msg = 0
queue = Queue.new("testing")
queue.subscribe do |obj|
msg += 1
@PabloC
PabloC / Usage
Created April 6, 2010 23:04 — forked from dougal/Usage
>> config.authentication.username
=> "bob@example.com@"
>> config.authentication.password
=> "myhackproofpassword"
# Author: Pieter Noordhuis
# Description: Simple demo to showcase Redis PubSub with EventMachine
#
# Requirements:
# - rubygems: eventmachine, thin, cramp, sinatra, yajl-ruby
# - a browser with WebSocket support
#
# Usage:
# ruby redis_pubsub_demo.rb
#
# Rails
alias ss="script/server"
alias sc="script/console"
alias sq="sqlite3 db/development.sqlite3"
alias sqldev="sqlite3 db/development.sqlite3"
alias svn_add_all="svn st --ignore-externals | grep ^? | sed 's/\?/svn add/' | sh"
alias svn_del_all="svn st --ignore-externals | grep ^? | sed 's/\!/svn del/' | sh"
alias cdp="cd $HOME/workspace/proyectos"
alias remove_svn="find . -type d -name .svn | xargs rm -rf"
CREATE TABLE "aeropuertos" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "descripcion" varchar(255) DEFAULT NULL NULL, "country_id" integer DEFAULT NULL NULL, "province_id" integer DEFAULT NULL NULL, "city_id" integer DEFAULT NULL NULL, "created_at" datetime DEFAULT NULL NULL, "updated_at" datetime DEFAULT NULL NULL);
CREATE TABLE "cities" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "description" varchar(255) DEFAULT NULL NULL, "province_id" integer DEFAULT NULL NULL, "created_at" datetime DEFAULT NULL NULL, "updated_at" datetime DEFAULT NULL NULL);
CREATE TABLE "countries" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "description" varchar(255) DEFAULT NULL NULL, "created_at" datetime DEFAULT NULL NULL, "updated_at" datetime DEFAULT NULL NULL);
CREATE TABLE "planes" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "codigo" varchar(255) DEFAULT NULL NULL, "cant_tripulacion" integer DEFAULT NULL NULL, "cant_asientos_turista" integer DEFAULT NULL NULL, "cant_asientos_business" integer DEFA