Skip to content

Instantly share code, notes, and snippets.

// ==UserScript==
// @name Gather.town Shortcuts (mac)
// @namespace ameboide
// @version 0.1
// @description Adds keyboard shortcuts to toggle mic/video
// @author aarellano (forked from ameboide)
// @match https://gather.town/app/*
// @grant none
// ==/UserScript==
@aarellano
aarellano / quehambre
Created July 22, 2013 17:44
Nginx configuration
upstream php {
server unix:/var/run/php5-fpm.socket;
}
# Non-www redirect
server {
listen 80;
# listen on the non-www host
server_name quehambre.cl;
@aarellano
aarellano / base_controller.rb
Created June 14, 2013 01:35
Problem with the url helper
#controllers/api/base_controller.rb
class Api::BaseController < ActionController::Base
before_filter :authenticate_user!
respond_to :json
end
# a hash
{ de: "Germany",
sk: "Slovakia",
hu: "Hungary",
us: "United States",
no: "Norway",
cl: "Chile" }.each { |domain, country| puts "#{country}: #{domain}" }
# blocks and closures
def greetings
@aarellano
aarellano / size.sql
Created November 30, 2012 20:52
Mysql size queries
SELECT table_schema "Data Base Name", SUM( data_length + index_length) / 1024 / 1024
"Data Base Size in MB" FROM information_schema.TABLES GROUP BY table_schema ;
SELECT TABLE_NAME, table_rows, data_length, index_length,
round(((data_length + index_length) / 1024 / 1024),2) "Size in MB"
FROM information_schema.TABLES WHERE table_schema = "db_name";
@aarellano
aarellano / size_by_database.sql
Created November 30, 2012 20:50
Size by database
SELECT table_schema "Data Base Name", SUM( data_length + index_length) / 1024 / 1024
"Data Base Size in MB" FROM information_schema.TABLES GROUP BY table_schema ;
@aarellano
aarellano / gist:3836890
Created October 4, 2012 22:33
Testing part 2
grace6:~: cat output1
1 8
2
3
4 DEVO 5 7 2 12
7 311
5 25 23
8 RUSH
8 15 13
10 PRINCE
@aarellano
aarellano / install_rvm.sh
Created March 21, 2012 14:36
Install RVM & ruby 1.9.3
bash -s stable < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)
echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # This loads RVM into a shell session.' >> ~/.bashrc
source ~/.bashrc
rvm install 1.9.3 && rvm use 1.9.3 --default
@aarellano
aarellano / gist:2067849
Created March 18, 2012 02:07
rvm requirements
$ rvm requirements
cat: /etc/*-release: No such file or directory
Requirements for Linux ( )
NOTE: 'ruby' represents Matz's Ruby Interpreter (MRI) (1.8.X, 1.9.X)
This is the *original* / standard Ruby Language Interpreter
'ree' represents Ruby Enterprise Edition
'rbx' represents Rubinius