Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am schleg on github.
  • I am schleg (https://keybase.io/schleg) on keybase.
  • I have a public key whose fingerprint is 2143 273A 56D4 7DBB 1220 7077 712A 5DB3 1029 8280

To claim this, I am signing this object:

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

@schleg
schleg / vim8.x_with_lua
Last active March 30, 2019 10:54 — forked from techgaun/vim8.x_with_lua
Install vim with lua support on ubuntu 16.04
# for Ubunto 16.04
sudo apt-get remove --purge vim vim-runtime vim-gnome vim-tiny vim-common vim-gui-common
sudo apt-get build-dep vim-gnome
sudo apt-get install build-essential liblua5.3-0 liblua5.3-dev python-dev ruby-dev libperl-dev libncurses5-dev libgnome2-dev libgnomeui-dev libgtk2.0-dev libatk1.0-dev libbonoboui2-dev libcairo2-dev libx11-dev libxpm-dev libxt-dev
sudo rm -rf /usr/local/share/vim /usr/bin/vim /usr/local/bin/vim
sudo mkdir /usr/include/lua5.2/{include,lib}
sudo cp /usr/include/lua5.2/*.h /usr/include/lua5.2/include/
sudo ln -sf /usr/lib/x86_64-linux-gnu/liblua5.2.so /usr/include/lua5.2/lib/liblua.so
sudo ln -sf /usr/lib/x86_64-linux-gnu/liblua5.2.a /usr/include/lua5.2/lib/liblua.a
@schleg
schleg / countCSSRules.js
Created December 5, 2015 06:17 — forked from psebborn/countCSSRules.js
Count the number of rules and selectors for CSS files on the page. Flags up the >4096 threshold that confuses IE
function countCSSRules() {
var results = '',
log = '';
if (!document.styleSheets) {
return;
}
for (var i = 0; i < document.styleSheets.length; i++) {
countSheet(document.styleSheets[i]);
}
function countSheet(sheet) {
@schleg
schleg / gist:b176d968b631b2c0de4d
Last active February 14, 2016 17:34
Rubinius on El Capitan
brew tap homebrew/versions
brew install llvm35 openssl
RUBY_CONFIGURE_OPTS="--with-lib-dir=$(brew --prefix openssl)/lib --with-include-dir=$(brew --prefix openssl)/include" rbenv install rbx-2.5.8
@schleg
schleg / set-boot2docker-date.sh
Created November 16, 2014 03:27
Sets the date correctly in the boot2docker host VM
boot2docker ssh sudo date -u -D %Y%m%dT%T --set="$(date -u +%Y%m%dT%T)"
@schleg
schleg / haproxy.conf
Created October 27, 2014 01:05
HAProxy Service Config
# /etc/init/haproxy.conf
description "HAProxy"
start on runlevel [2345]
stop on runlevel [016]
respawn
respawn limit 2 5
@schleg
schleg / haproxy.cfg
Last active August 29, 2015 14:08
Docker Host HAProxy Config
# /etc/haproxy/haproxy.cfg
global
daemon
maxconn 4096
defaults
mode http
timeout connect 5000ms
timeout client 50000ms
@schleg
schleg / setup-docker-ubuntu.sh
Last active August 29, 2015 14:08
Setup Docker on Ubuntu 14.04
#!/bin/bash
sh -c "wget -qO- https://get.docker.io/gpg | apt-key add -"
sudo sh -c "echo deb http://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list"
apt-get update
apt-get install -y lxc-docker haproxy git-core
@schleg
schleg / gist:ded4064992518e706259
Last active August 29, 2015 14:06
docker-setup-ubuntu-do
# update packages
sudo aptitude update
sudo aptitude -y upgrade
# aufs support
sudo aptitude install linux-image-extra-`uname -r`
# add docker repo key
sudo sh -c "wget -qO- https://get.docker.io/gpg | apt-key add -"