Skip to content

Instantly share code, notes, and snippets.

View ecin's full-sized avatar
🐶
Woof!

ecin ecin

🐶
Woof!
View GitHub Profile

Keybase proof

I hereby claim:

  • I am ecin on github.
  • I am ecin (https://keybase.io/ecin) on keybase.
  • I have a public key ASDGHjmcEvGxyxgV1G1LxD5KhYpkI1iUaWMcjA__WSyvJAo

To claim this, I am signing this object:

@ecin
ecin / Dockerfile
Created February 12, 2014 10:21
Dockerfile for Ghost
FROM centos
MAINTAINER ecin <[email protected]>
RUN yum -y update
RUN yum -y groupinstall "Development Tools"
# Install Node
RUN curl -LO https://github.com/joyent/node/archive/v0.10.25.zip
RUN unzip v0.10.25.zip
RUN cd node-0.10.25 && ./configure && make install
@ecin
ecin / post-commit
Created October 28, 2013 14:54
git post-commit signature
#!/bin/sh
#
# Sign the just-made commit with a globally configured GPG key.
git commit --amend --allow-empty --gpg-sign=`git config user.signingkey` --reuse-message=HEAD
@ecin
ecin / ohash.rb
Created October 16, 2013 16:43
OStruct-like that raises raises error on non-existent keys.
class OHash < Hash
def initialize(key_values)
key_values.each { |key, value| self[key] = value }
end
def method_missing(key)
if self.has_key?(key)
return self[key]
else
raise NoMethodError
@ecin
ecin / mapper.rb
Last active December 20, 2015 08:19
How to add a Rails routes helper (tightly-coupled version).
# config/initializers/extensions/action_dispatch/routing/mapper.rb
module ActionDispatch
module Routing
class Mapper
module Resources
alias_method :old_add_route, :add_route
def add_route(action, options)
if @scope[:throttle]
throttlers = @scope.delete(:throttle)
@ecin
ecin / goarena.go
Created August 31, 2012 17:34
Dtrace probes in your Golang code
package main
/*
Ping vs Pong: A Gladiatorial Match
Two goroutines enter, only one leaves...
*/
/*
#cgo LDFLAGS: -lprobes -L/usr/local/lib
#include "probes.h"
@ecin
ecin / timelog.txt
Created June 27, 2012 21:01
Organize by tasks taking most time
http://cl.ly/1L1H1s1T1b2Y2x3v2G41
@ecin
ecin / phantomjs_facebook.js
Created April 23, 2012 21:06
Log into Facebook with phantomJS
console.log("got here");
var page = require('webpage').create();
page.onConsoleMessage = function(msg) {
console.log(msg);
};
page.open("http://facebook.com", function(status) {
if ( status === "success" ) {
@ecin
ecin / github-pinboard-include.html
Created January 24, 2012 08:23
github-pinboard-include
<script src="http://copypastel.github.com/github-pinboard/lib/githubPinboard.js"></script>
@ecin
ecin / lobster.rb
Created September 4, 2011 06:13
Using Rack apps in Goliath.
require 'goliath'
require 'rack/lobster'
class Lobster < Goliath::API
map '/' do
run Rack::Lobster.new
end
end