Skip to content

Instantly share code, notes, and snippets.

View luizsignorelli's full-sized avatar

Luiz Fernando Signorelli luizsignorelli

View GitHub Profile
@luizsignorelli
luizsignorelli / GodSet.java
Created April 19, 2018 12:48
The Godfathers Set
import org.junit.Before;
import org.junit.Test;
import static org.junit.Assert.*;
public class GodSetTest {
private GodSet emptySet;
private GodSet oneElementSet;
private GodSet moreThanOneElementSet;
# for golang
# mkdir $HOME/go
# mkdir -p $GOPATH/src/github.com/user
export GOPATH=$HOME/go
export PATH=$PATH:$GOPATH/bin
@luizsignorelli
luizsignorelli / print-gihub-wiki.js
Last active December 11, 2015 11:48
Remove unneeded parts of a github wiki page making it suitable for printing.
$(".header").remove()
$(".repohead").remove()
$(".tabnav").remove()
$(".wiki-actions").remove()
$(".site-footer").remove()
$("#wiki-rightbar").remove()
$(".repository-sidebar").remove()
@luizsignorelli
luizsignorelli / gist:1503639
Created December 20, 2011 22:39 — forked from dx7/gist:1333785
Installing ruby-debug with ruby-1.9.3-p0
# Install with:
# bash < <(curl -L https://raw.github.com/gist/1333785)
#
# Reference: http://blog.wyeworks.com/2011/11/1/ruby-1-9-3-and-ruby-debug
echo "Installing ruby-debug with ruby-1.9.3-p0 ..."
curl -OL http://rubyforge.org/frs/download.php/75414/linecache19-0.5.13.gem
curl -OL http://rubyforge.org/frs/download.php/75415/ruby-debug-base19-0.11.26.gem
@luizsignorelli
luizsignorelli / gist:1503634
Created December 20, 2011 22:38 — forked from phillipkoebbe/gist:1457544
Installing ruby-debug19 on ruby 1.9.3-p0 on Mac OS X Lion 10.7.2 with Xcode 4.2.1
# assumes 1.9.3-p0 is already installed in RVM (1.9.2) and you are in an empty gemset
curl -OL http://rubyforge.org/frs/download.php/75414/linecache19-0.5.13.gem
curl -OL http://rubyforge.org/frs/download.php/75415/ruby-debug-base19-0.11.26.gem
gem install rake
gem install archive-tar-minitar
gem install ruby_core_source
gem install columnize
gem install linecache19-0.5.13.gem -- --with-ruby-include="$rvm_path/src/`rvm tools strings`"
gem install ruby-debug-base19-0.11.26.gem -- --with-ruby-include="$rvm_path/src/`rvm tools strings`"
@luizsignorelli
luizsignorelli / gist:1503567
Created December 20, 2011 22:24
ruby tips
# install ruby-debug on ruby 1.9.3
bash < <(curl -L https://raw.github.com/gist/1333785)
@luizsignorelli
luizsignorelli / Test with CURL
Created November 3, 2011 18:03 — forked from pointcom/Test with CURL
Serving rails page caches to a facebook POST request with nginx (error)
$ curl -X GET http://localhost:4000/page.html
Hello World
$ curl -X POST http://localhost:4000/page.html -d ""
<html>
<head><title>405 Not Allowed</title></head>
<body bgcolor="white">
<center><h1>405 Not Allowed</h1></center>
<hr><center>nginx/0.6.34</center>
</body>
@luizsignorelli
luizsignorelli / benchmark.sh
Created August 10, 2011 16:59 — forked from emersonmoretto/benchmark.sh
Apache bench + Gnuplot Script
#!/bin/bash
echo -e "\nbenchmark.sh -n<number of requests> -c<number of concurrency> <URL1> <URL2> ..."
echo -e "\nEx: benchmark.sh -n100 -c10 http://www.google.com/ http://www.bing.com/ \n"
## Gnuplot settings
echo "set terminal png
set output 'benchmark_${1}_${2}.png'
set title 'Benchmark: ${1} ${2}'
@luizsignorelli
luizsignorelli / gist:1073144
Created July 9, 2011 00:43
JQuery Plugins
other great plugins: https://github.com/SamWM/jQuery-Plugins
numeric, integer text inputs: https://github.com/SamWM/jQuery-Plugins/tree/master/numeric
replace for alert confirms: https://github.com/neerajdotname/iconfirm
always at bottm: https://github.com/neerajdotname/always_at_bottom
# See the process that's using the port
lsof -i tcp:<port_number>
#ssh tunel
ssh -f user@<remote_server> -L <local_port>:<another_remote_server>:<remote_port> -N