Skip to content

Instantly share code, notes, and snippets.

View jweslley's full-sized avatar

Jonhnny Weslley jweslley

View GitHub Profile
@jweslley
jweslley / seeds.rb
Created July 21, 2010 14:08
Rails: loading seeds from csv
require 'csv'
CSV.foreach('path/to/seed.csv', headers: true, col_sep: ';') do |row|
Model.create row.to_hash
end
@jweslley
jweslley / recover grub
Created July 6, 2010 15:11
recover grub
sudo grub
root (hd0,1)
setup (hd0)
quit
package net.abhinavsarkar.util;
import java.util.Iterator;
import java.util.concurrent.BrokenBarrierException;
import java.util.concurrent.CyclicBarrier;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.SynchronousQueue;
import java.util.concurrent.ThreadFactory;
import java.util.concurrent.TimeUnit;
/*
* This is the Towers of Hanoi example from the prolog tutorial [1]
* converted into Scala, using implicits to unfold the algorithm at
* compile-time.
*
* [1] http://www.csupomona.edu/~jrfisher/www/prolog_tutorial/2_3.html
*/
object TowersOfHanoi {
import scala.reflect.Manifest
@jweslley
jweslley / LaTeX Brazilian
Created August 25, 2009 16:38
LaTeX Brazilian
% apt-get install texlive-portuguese
\usepackage[brazilian]{babel}