Skip to content

Instantly share code, notes, and snippets.

@burke
burke / 0-readme.md
Created January 27, 2012 13:44 — forked from funny-falcon/cumulative_performance.patch
ruby-1.9.3-p327 cumulative performance patch for rbenv

ruby-1.9.3-p327 cumulative performance patch for rbenv

This installs a patched ruby 1.9.3-p327 with various performance improvements and a backported COW-friendly GC, all courtesy of funny-falcon.

Requirements

You will also need a C Compiler. If you're on Linux, you probably already have one or know how to install one. On OS X, you should install XCode, and brew install autoconf using homebrew.

@caseywatts
caseywatts / 0-self-publishing.md
Last active April 7, 2024 21:25
Self-Publishing via Markdown
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@adrienbrault
adrienbrault / purge.sh
Created September 24, 2012 10:02
Script to reduce VM size before packaging for vagrant
#!/bin/sh
# Credits to:
# - http://vstone.eu/reducing-vagrant-box-size/
# - https://github.com/mitchellh/vagrant/issues/343
aptitude -y purge ri
aptitude -y purge installation-report landscape-common wireless-tools wpasupplicant ubuntu-serverguide
aptitude -y purge python-dbus libnl1 python-smartpm python-twisted-core libiw30
aptitude -y purge python-twisted-bin libdbus-glib-1-2 python-pexpect python-pycurl python-serial python-gobject python-pam python-openssl libffi5
@adharris
adharris / postgres_array.go
Created November 28, 2012 19:52
PostgreSQL demo of Array types using Golang
package main
import (
"database/sql"
"errors"
"fmt"
_ "github.com/bmizerany/pq"
"os"
"regexp"
"strings"
@swalkinshaw
swalkinshaw / tutorial.md
Last active November 13, 2023 08:40
Designing a GraphQL API
@dnishimura
dnishimura / Makefile.golang
Created June 20, 2012 17:51 — forked from yanatan16/Makefile.golang
Makefile for Golang projects
# Makefile for a go project
#
# Author: Jon Eisen
# site: joneisen.me
#
# Targets:
# all: Builds the code
# build: Builds the code
# fmt: Formats the source files
# clean: cleans the code
@dergachev
dergachev / squid-deb-proxy_on_docker.md
Last active May 25, 2023 03:55
Caching debian package installation with docker

TLDR: I now add the following snippet to all my Dockerfiles:

# If host is running squid-deb-proxy on port 8000, populate /etc/apt/apt.conf.d/30proxy
# By default, squid-deb-proxy 403s unknown sources, so apt shouldn't proxy ppa.launchpad.net
RUN route -n | awk '/^0.0.0.0/ {print $2}' > /tmp/host_ip.txt
RUN echo "HEAD /" | nc `cat /tmp/host_ip.txt` 8000 | grep squid-deb-proxy \
  && (echo "Acquire::http::Proxy \"http://$(cat /tmp/host_ip.txt):8000\";" > /etc/apt/apt.conf.d/30proxy) \
  && (echo "Acquire::http::Proxy::ppa.launchpad.net DIRECT;" >> /etc/apt/apt.conf.d/30proxy) \
  || echo "No squid-deb-proxy detected on docker host"
@fnichol
fnichol / README.md
Last active April 27, 2023 15:24
Auto-enable Local HTTP Caching in Test Kitchen

Auto-enable Local HTTP Caching in Test Kitchen

Note: total experiment and hack, looks nasty, could be awesome:

Setup

  • Drop the kitchen.local.yml into $HOME/.kitchen/config.yml
  • Install polipo (with Mac: brew install polipo, with Ubuntu: apt-get install polipo)
  • Drop polipo-start and polipo-console somewhere useful (perhaps $HOME/bin?)
@wofeiwo
wofeiwo / gist:3634357
Created September 5, 2012 10:00
Golang daemonize
/* ivan(a.t)mysqlab.net */
package main
import (
"syscall"
"os"
"log"
)
func daemon(nochdir, noclose int) int {