Skip to content

Instantly share code, notes, and snippets.

@rgaidot
rgaidot / Gemfile
Created Feb 16, 2014
Ruby on Rails Lightweight
View Gemfile
source :rubygems
gem "actionpack", "~> 4.0"
gem "railties", "~> 4.0"
gem "tzinfo"
gem "thin"
View bye.sh
#!/bin/bash
kill -9 `ps ax | grep "$1" | awk '{print $1}'` &2>/dev/null
echo "byebye $1 :-)"
@rgaidot
rgaidot / highlight-html-elements.js
Last active Aug 29, 2015
highlight html elements
View highlight-html-elements.js
for(i=0; A=$$("*")[i++];)
A.style.outline="1px solid hsl("+i*9+",99%,50%)"
View facebook_friends_ranking.js
function creator(o, data, node){
var content = document.createElement(node);
content.cellspacing = "3"
var cell = document.createTextNode(data);
content.appendChild(cell);
o.appendChild(content);
}
function displayData(arr){
var table = document.createElement('table');
var thead = document.createElement('thead');
View mesosphere.sh
#! /bin/bash
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv E56151BF
DISTRO=$(lsb_release -is | tr '[:upper:]' '[:lower:]')
CODENAME=$(lsb_release -cs)
echo "deb http://repos.mesosphere.io/${DISTRO} ${CODENAME} main" | sudo tee /etc/apt/sources.list.d/mesosphere.list
sudo apt-get -y update --fix-missing
sudo apt-get -y install mesosphere
View yin-yang.rb
require 'continuation'
#
# Messing around with mimicking Scheme in Ruby by implementing the Yin/Yang puzzle with Kernel#callcc and a fake 'let' macro
#
# See also:
# http://blog.gonzih.me/blog/2013/11/26/yin-yang-callcc-puzzle-in-ruby/,
# http://stackoverflow.com/questions/16843853/how-to-implement-let-in-scheme
#
# In Scheme (the original)
View keybase.md

Keybase proof

I hereby claim:

  • I am rgaidot on github.
  • I am rgaidot (https://keybase.io/rgaidot) on keybase.
  • I have a public key whose fingerprint is D9ED 7BB2 9708 4E2A 9EE5 5729 48EF EB51 7678 6B01

To claim this, I am signing this object:

View lastfm-very-simple-recommender.rb
# This script just get the latest tracks of your friends on Last.fm and recommends those more popular.
# It's all based on a conversation between @mort, @rochgs, @littlemove and me (mainly by @mort)
# INSTRUCTIONS
# 1. Install lastfm gem: https://github.com/youpy/ruby-lastfm/
# gem install lastfm
# 2. Get a Last.fm API Key on http://www.lastfm.es/api
require 'lastfm'
@rgaidot
rgaidot / elasticoverflow.rb
Created May 4, 2011 — forked from karmi/elasticoverflow.rb
Importing and searching RSS with ElasticSearch and Tire
View elasticoverflow.rb
# =======================================================
# Importing and searching RSS with ElasticSearch and Tire
# =======================================================
#
# This script downloads, parses and indexes Stackoverflow RSS feed with ElasticSearch
# via the [Tire](https://github.com/karmi/tire) Rubygem.
#
# Requirements
# ------------
#
View simple-rails-template.rb
#
# Simple Rails Template
#
# e.g: rails new myapp -d mysql -m http://.../simple-rails-template.rb
#
# Enjoy !
#
# ~ @rgaidot
#
You can’t perform that action at this time.