Skip to content

Instantly share code, notes, and snippets.

@juniorz
juniorz / Dockerfile
Last active December 28, 2015 11:39
Jenkins
# -------------------------------------------------------------------
# docker build -t juniorz/jenkins git://gist.github.com/7494802.git
# -------------------------------------------------------------------
FROM phusion/baseimage:0.9.1
MAINTAINER Reinaldo Junior <[email protected]>
RUN apt-get update && apt-get upgrade -y
# Remove authentication rights for insecure_key.
RUN echo /bin/sh -c \"rm -f /root/.ssh/authorized_keys /home/*/.ssh/authorized_keys\" > /sbin/remove_authorized_keys &&\
require 'rubygems'
require 'fog'
Fog.mock!
describe 'Bug' do
it 'should not fail' do
compute = Fog::Compute.new(
:provider => 'openstack',
:openstack_username => 'user',
@juniorz
juniorz / sfml.rb
Last active December 10, 2015 13:18
Homebrew SFML formula
require 'formula'
# Documentation: https://github.com/mxcl/homebrew/wiki/Formula-Cookbook
# PLEASE REMOVE ALL GENERATED COMMENTS BEFORE SUBMITTING YOUR PULL REQUEST!
class Sfml < Formula
homepage 'http://www.sfml-dev.org'
version '2.0-rc'
url 'https://github.com/LaurentGomila/SFML/archive/2.0-rc.zip'
@juniorz
juniorz / robot.js
Created December 7, 2012 23:16
Jaba
//FightCode can only understand your robot
//if its class is called Robot
var Robot = function(robot) {
var count = 0;
var width = 13; // 13px
};
Robot.prototype.turnTo = function(robot, degree) {
@juniorz
juniorz / robot.js
Created December 7, 2012 23:04 — forked from yuyi/robot.js
OPENROBOT
function Robot(robot) {
this.dd = false;
}
// well, we need to do something...
// whenever our robot is idle, this method gets called.
Robot.prototype.onIdle = function(ev) {
var robot = ev.robot;
@juniorz
juniorz / robot.js
Created December 7, 2012 23:03 — forked from yuyi/robot.js
OPENROBOT
function Robot(robot) {
this.dd = false;
}
// well, we need to do something...
// whenever our robot is idle, this method gets called.
Robot.prototype.onIdle = function(ev) {
var robot = ev.robot;
@juniorz
juniorz / robot.js
Created December 5, 2012 16:35
Kingnaldo
//FightCode can only understand your robot
//if its class is called Robot
var Robot = function(robot) {
robot.clone();
if(robot.parentId){
robot.turn(90);
robot.ahead(50);
}
@juniorz
juniorz / install.txt
Created November 6, 2012 02:17
How to fix memory leak in capybara-webkit
webkit_server (capybara-webkit) leaks memory on the following environment:
* Mac OS X Mountain Lion (10.8.2)
* XQuartz 2.7.4
* Qt 4.8.3
How to fix:
1) Downgrade Qt to 4.7.4
brew unlink qt
cd `brew --prefix`
@juniorz
juniorz / 1_existing_app.rb
Created January 19, 2012 11:50
Rails 3 Auto-concerner
class User < ActiveRecord::Base
end
@juniorz
juniorz / rails_engine_hooks.rb
Created January 17, 2012 12:14
Principais hooks do Rails
module MyAwesomeEngine
class Engine < Rails::Engine
#isolate_namespace MyAwesomeEngine
config.after_initialize do
puts "Terminou a inicializacao"
end
# Antes de cada requisição (1 vez em production e sempre em development)
config.to_prepare do