Skip to content

Instantly share code, notes, and snippets.

View rodrigodealer's full-sized avatar

Rodrigo Oliveira rodrigodealer

View GitHub Profile
# go to jdk1.6's home
cd /System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home
# check your correct java version installed before running this command
sudo ln -s /Library/Java/JavaVirtualMachines/1.6.0_22-b04-314.jdk/Contents/Home/src.jar src.jar
# now your Eclipse IDE can find and define both the source and doc for its jvm, yupi! ;-)
@rodrigodealer
rodrigodealer / node-and-npm-in-30-seconds.sh
Created April 24, 2011 12:43 — forked from isaacs/node-and-npm-in-30-seconds.sh
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at http://joyeur.com/2010/12/10/installing-node-and-npm/ Note: npm >=0.3 is *safer* when using sudo.
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl http://npmjs.org/install.sh | sh
@rodrigodealer
rodrigodealer / build.xml
Created April 24, 2011 19:04
Ivy example
<project name="hello-ivy" default="run" xmlns:ivy="antlib:org.apache.ivy.ant">
<property name="lib.dir" value="lib" />
<property name="build.dir" value="build" />
<property name="src.dir" value="src" />
<!-- paths used for compilation and run -->
<path id="lib.path.id">
<fileset dir="${lib.dir}" />
</path>
@rodrigodealer
rodrigodealer / default
Created July 29, 2011 14:38
nginx for node.js using socket.io
worker_processes 4;
events {
worker_connections 1024;
}
http {
server {
listen 80;
gzip on;
@rodrigodealer
rodrigodealer / httpd.conf
Created October 17, 2011 11:26
Gzip, Expires e Proxypass no Apache2
<Location />
# AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css image/gif image/png image/jpg
# SetOutputFilter DEFLATE
# BrowserMatch ^Mozilla/4 gzip-only-text/html
# BrowserMatch ^Mozilla/4\.0[678] no-gzip
# BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
# AddOutputFilterByType DEFLATE text/html text/plain text/css image/gif image/png image/jpg application/x-javascript
# BrowserMatch ^Mozilla/4 gzip-only-text/html
# BrowserMatch ^Mozilla/4\.0[678] no-gzip
# BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
@rodrigodealer
rodrigodealer / gist:1835923
Created February 15, 2012 14:02
Json serialization for vraptor
package br.com.pordotom.util;
import br.com.caelum.vraptor.interceptor.TypeNameExtractor;
import br.com.caelum.vraptor.ioc.Component;
import br.com.caelum.vraptor.serialization.ProxyInitializer;
import br.com.caelum.vraptor.serialization.xstream.XStreamBuilder;
import br.com.caelum.vraptor.serialization.xstream.XStreamJSONSerialization;
import com.thoughtworks.xstream.XStream;
import com.thoughtworks.xstream.converters.basic.DateConverter;
@rodrigodealer
rodrigodealer / app.conf
Last active October 13, 2015 07:28 — forked from shapeshed/unicorn
Unicorn / Monit setup
RAILS_ENV=production
RAILS_ROOT=/home/deploy/apps/app/current
USER=deploy
START_CMD="/home/deploy/.rbenv/shims/bundle exec unicorn -c config/unicorn.rb -E production -D"
UNICORN_CONFIG=$RAILS_ROOT/config/unicorn.rb
PID="/home/deploy/shared/pids/unicorn.pid"
@rodrigodealer
rodrigodealer / default.vcl
Created August 28, 2013 22:18
Simple varnish setup
backend default {
.host = "127.0.0.1";
.port = "80";
}
sub vcl_recv {
if(req.url ~ "sign_in" || req.url ~ "sign_out" || req.request == "POST" || req.request == "PUT" || req.request == "DELETE") {
return (pass);
}
@rodrigodealer
rodrigodealer / anmeldung.rb
Created September 7, 2017 08:40
Anmeldung for berlin
#!/usr/bin/env ruby
# make sure you the watir gem installed -> gem install watir
require 'watir'
def log (message) puts " #{message}" end
def success (message) puts "+ #{message}" end
def fail (message) puts "- #{message}" end
def notify (message)
success message.upcase
system 'osascript -e \'Display notification Burgerbot with title "%s"\'' % message
rescue StandardError => e
@rodrigodealer
rodrigodealer / go-os-arch.md
Created February 27, 2019 15:41 — forked from asukakenji/0-go-os-arch.md
Go (Golang) GOOS and GOARCH

Go (Golang) GOOS and GOARCH

All of the following information is based on go version go1.8.3 darwin/amd64.

A list of valid GOOS values

(Bold = supported by go out of the box, ie. without the help of a C compiler, etc.)

  • android
  • darwin