Skip to content

Instantly share code, notes, and snippets.

View pedroteixeira's full-sized avatar

Pedro Henriques dos Santos Teixeira pedroteixeira

View GitHub Profile
require 'zmq'
require 'msgpack'
context = ZMQ::Context.new
worker_socket = context.socket ZMQ::REP
worker_socket.connect "tcp://127.0.0.1:5555"
count = 0
@peternixey
peternixey / securing_rails_updates.md
Created March 5, 2012 13:10
How Homakov hacked GitHub and how to protect your application by Peter Nixey

##How Homakov hacked GitHub and the line of code that could have prevented it


Please note: THIS ARTICLE IS NOT WRITTEN BY THE GITHUB TEAM or in any way associated with them. It's simply hosted as a Gist because the markdown formatting is excellent and far clearer than anything I could manage on my personal Tumblr at peternixey.com.

If you'd like to follow me on twitter my handle is @peternixey


@Christophe31
Christophe31 / tornado_django_wrapper.py
Created February 29, 2012 10:43
tornado django wrapper
############# init parent django project settings
from os import path
import sys
sys.path.append(path.dirname(path.dirname(path.abspath(__file__))))
import settings
from django.core.management import setup_environ
setup_environ(settings)
###############
@lynaghk
lynaghk / main.clj
Created January 6, 2012 15:26
Cassowary constraint solver in ClojureScript
;;Using the Cassowary constraint solver from ClojureScript
;;This demo shows using multimethods for readable constraint syntax using +, -, and =.
;;Output is a row of circles with random radii spaced so that the space between their boundaries is uniform.
(ns c2.main
;;refer-clojure :exclude is currently broken in ClojureScript master
;;Ticket open: http://dev.clojure.org/jira/browse/CLJS-114
;;Fix applied here: https://github.com/lynaghk/clojurescript/tree/114-refer-clojure-exclude
(:refer-clojure :exclude [+ - =])
@jlbfalcao
jlbfalcao / gist:1043984
Created June 24, 2011 00:37
Build jruby-1.6.2 RPM
wget http://jruby.org.s3.amazonaws.com/downloads/1.6.2/jruby-bin-1.6.2.tar.gz
tar -xvzf jruby-bin-1.6.2.tar.gz
cat > post-install.sh <<EOF
echo "PATH=/opt/jruby-1.6.2/bin:\\\${PATH}" > /etc/profile.d/jruby.sh
chmod +x /etc/profile.d/jruby.sh
EOF
cat > pre-uninstall.sh <<EOF
rm /etc/profile.d/jruby.sh
EOF
@technoweenie
technoweenie / github_oauth_busy_developer_guide.md
Created May 30, 2010 18:34
GitHub OAuth Busy Developer's Guide

GitHub OAuth Busy Developer's Guide

This is a quick guide to OAuth2 support in GitHub for developers. This is still experimental and could change at any moment. This Gist will serve as a living document until it becomes finalized at Develop.GitHub.com.

OAuth2 is a protocol that lets external apps request authorization to private details in your GitHub account without getting your password. All developers need to register their application before getting started.

Web Application Flow

  • Redirect to this link to request GitHub access: