Skip to content

Instantly share code, notes, and snippets.

View giubueno's full-sized avatar

Giulliano Bueno giubueno

View GitHub Profile
@giubueno
giubueno / nginx.conf
Created November 24, 2017 10:22 — forked from Stanback/nginx.conf
Example Nginx configuration for adding cross-origin resource sharing (CORS) support to reverse proxied APIs
#
# CORS header support
#
# One way to use this is by placing it into a file called "cors_support"
# under your Nginx configuration directory and placing the following
# statement inside your **location** block(s):
#
# include cors_support;
#
# As of Nginx 1.7.5, add_header supports an "always" parameter which
@giubueno
giubueno / Install-Docker-on-Linux-Mint.sh
Created February 20, 2017 08:56 — forked from sirkkalap/Install-Docker-on-Linux-Mint.sh
Install Docker on Linux Mint
##########################################
# To run:
# curl -sSL https://gist.githubusercontent.com/sirkkalap/e87cd580a47b180a7d32/raw/d9c9ebae4f5cf64eed4676e8aedac265b5a51bfa/Install-Docker-on-Linux-Mint.sh | bash -x
##########################################
# Check that HTTPS transport is available to APT
if [ ! -e /usr/lib/apt/methods/https ]; then
sudo apt-get update
sudo apt-get install -y apt-transport-https
fi
@giubueno
giubueno / tmux-cheatsheet.markdown
Created April 14, 2016 10:39 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
package spullara.util.concurrent;
import org.junit.BeforeClass;
import org.junit.Test;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.concurrent.*;
import java.util.concurrent.atomic.AtomicBoolean;
@giubueno
giubueno / database.yml.example mysql2
Created December 1, 2015 23:43 — forked from erichurst/database.yml.example mysql2
Rails 3 database.yml examples
# MySQL. Versions 4.1 and 5.0 are recommended.
#
# Install the MySQL driver:
# gem install mysql2
#
# And be sure to use new-style password hashing:
# http://dev.mysql.com/doc/refman/5.0/en/old-client.html
development:
adapter: mysql2
encoding: utf8
#! /bin/sh
### BEGIN INIT INFO
# Provides: redis-server
# Required-Start: $syslog
# Required-Stop: $syslog
# Should-Start: $local_fs
# Should-Stop: $local_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: redis-server - Persistent key-value db
@giubueno
giubueno / 0-readme.md
Last active August 29, 2015 13:56 — forked from crmaxx/0-readme.md

Amazon AWS EC2 production for Ruby on Rails

Prepare cloud

Speed up ssh login

echo 'UseDNS no # if slow connection' >> /etc/ssh/sshd_config
echo 'PrintMotd yes # if you need motd messages' >> /etc/ssh/sshd_config

From /etc/pam.d/login && /etc/pam.d/sshd delete all strings included

session optional pam_motd.so
@giubueno
giubueno / robot.js
Created December 5, 2012 18:40 — forked from reginaldosousa/robot.js
Zolmeister
var Robot = function(robot){
robot.turnLeft(robot.angle % 90);
};
Robot.prototype.onIdle = function(ev) {
var robot = ev.robot;
if (robot.parentId) {
robot.back(1);
robot.turnGunRight(1);
}
else {
@giubueno
giubueno / robot.js
Created December 3, 2012 16:50
testmoep
//FightCode can only understand your robot
//if its class is called Robot
var Robot = function(robot) {
};
Robot.prototype.onIdle = function(ev) {
var robot = ev.robot;
robot.ahead(100);
@giubueno
giubueno / robot.js
Created December 3, 2012 16:39 — forked from heynemann/robot.js
Metal Go XP
//FightCode can only understand your robot
//if its class is called Robot
var Robot = function(robot){
//robot.ignore('onRobotCollision');
};
Robot.prototype.onIdle = function(ev) {
var robot = ev.robot;
robot.turn(1);