Skip to content

Instantly share code, notes, and snippets.

@beagleknight
beagleknight / gist:1283945
Created October 13, 2011 10:44
Nginx+SSL: Remove the password from the key file
mv ssl.key bak.key
openssl rsa -in bak.key -out ssl.key
@beagleknight
beagleknight / gist:1336318
Created November 3, 2011 11:49
Undefined Method ‘write’ for Syck::Emitter
RUBYOPT='-rpsych' bundle install
@beagleknight
beagleknight / boot.rb
Created November 17, 2011 09:40
can't convert nil into Hash
require 'rubygems'
require 'yaml'
YAML::ENGINE.yamler= 'syck'
# Set up gems listed in the Gemfile.
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
@beagleknight
beagleknight / application_controller.rb
Created December 21, 2011 14:41
Facebook, IE and iFrames
before_filter :set_p3p
def set_p3p
response.headers["P3P"]='CP="CAO PSA OUR"'
end
@beagleknight
beagleknight / gist:1894062
Created February 23, 2012 18:03
gem install capybara-webkit
% gem install capybara-webkit -v '0.10.0'
Building native extensions. This could take a while...
ERROR: Error installing capybara-webkit:
ERROR: Failed to build gem native extension.
/usr/local/rvm/rubies/ruby-1.9.3-preview1/bin/ruby extconf.rb
@beagleknight
beagleknight / Gemfile
Created November 19, 2012 22:41
thin on Windows
gem 'thin', '1.3.1'
gem 'eventmachine', '1.0.0.rc.1'
@beagleknight
beagleknight / main.js
Created December 10, 2012 18:19
Script position
var csv = require('csv'),
fs = require('fs');
csv()
.from.stream(fs.createReadStream(__dirname + "/scores.csv"))
.to.path(__dirname + "/scores_with_position.csv")
.transform(function (data, index) {
data.push(index + 1);
return data;
});
@beagleknight
beagleknight / tumblr_game.js
Created November 8, 2013 23:07
Simple game for my tumblr
var CANVAS_WIDTH = 200,
CANVAS_HEIGHT = 100,
canvas = document.getElementById("microgame"),
ctx = canvas.getContext("2d"),
player = {
x: 30,
y: CANVAS_HEIGHT - 20,
w: 20,
h: 20,
score: 0,
Itnig attends NoSQL Matters 2014 in Barcelona
docker run --restart=always --name redis -p 6379:6379 -v /var/lib/redis:/data -d redis
docker run --restart=always --name mysql -p 3306:3306 -v /var/lib/mysql:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=password -d mysql
docker run --restart=always --name mongo -p 27017:27017 -v ~/mongodb:/data/db -d mongo