Skip to content

Instantly share code, notes, and snippets.

View specialunderwear's full-sized avatar

Voxin Muyli specialunderwear

View GitHub Profile
@specialunderwear
specialunderwear / route-me.podspec
Last active December 14, 2015 06:59
route-me alpstein Podfile
Pod::Spec.new do |s|
s.name = "route-me"
s.summary = "route-me alpstein fork"
s.version = "0.0.1"
s.summary = "Route-Me is an open source map library that runs natively on iOS."
s.homepage = "https://github.com/Alpstein/route-me"
s.license = { :type => "Free",
:file => 'LicenseRouteMe.txt' }
s.author = { "Route-Me Contributors" => "route-me@github.com" }
s.source = { :git => "https://github.com/Alpstein/route-me.git", :branch => 'release' }
[buildout]
eggs = pip
[protobufsucks]
recipe = collective.recipe.cmd
on_install=true
cmds = ${buildout:directory}/bin/pip install protobuf
@specialunderwear
specialunderwear / haproxy.cfg.erb
Created September 5, 2012 22:51
haproxy config file
global
maxconn 4096
pidfile /var/run/haproxy.pid
daemon
defaults
mode http
retries 3
option redispatch
maxconn 2000
@specialunderwear
specialunderwear / haproxy.pp
Created September 5, 2012 22:51
haproxy config
# collect all the servers with *role* `node`.
$nodes = servers_with_role('node')
# render a template in wich we use these servers.
$configfile = template('path-to-template/configfile.erb')
package {"haproxy":
ensure => installed,
}
@specialunderwear
specialunderwear / node.pp
Created September 5, 2012 22:49
kick the loadbalander from the node.
# kick haproxy so it rebuilds it config.
notify {"kick -> haproxy":}
@specialunderwear
specialunderwear / README.rst
Last active October 6, 2015 03:38
debianize

Debianize, create debian packages from python packages

Debianize uses fpm (https://github.com/jordansissel/fpm) to create debian packages from python source directories. The only thing it really adds, is that debianize will also create packages for all depencencies that your source package has (install_requires). Debianize will only create a debian package from a python package. So you need a setup.py.

Usage

:

@specialunderwear
specialunderwear / many.sh
Created March 2, 2012 12:08
Spawn many processes and wait for all of them to complete
#! /bin/bash
FAIL=0
VERBOSE=0
SLEEP="0"
# parse options
while getopts "vw:d" opt; do
case $opt in
v)
@specialunderwear
specialunderwear / omgwtfbbq.js
Created January 30, 2012 00:45
Change all prototypes
> Object.prototype.i_am_everywhere = function() {
> return 'I am everywhere';
> };
> document.i_am_everywhere();
'I am everywhere'
> var non_believer = "not here you're not!";
> non_believer.i_am_everywhere();
'I am everywhere'
@specialunderwear
specialunderwear / changeprototype.js
Created January 30, 2012 00:44
Change prototype and existing objects change as well
> var a = Counter;
> a;
0
> a.next();
1
> a.before();
Error: function before is not defined.
> Counter.prototype.before = function() {
> return this - 1;
> };
@specialunderwear
specialunderwear / nextisprototype.js
Created January 30, 2012 00:33
next is defined only on the prototype
> var count = Counter;
> count.next();
Error: function next is not defined.