Skip to content

Instantly share code, notes, and snippets.

View sandervd's full-sized avatar

Sander Van Dooren sandervd

  • Essential Complexity
  • Leuven, Belgium
View GitHub Profile
@gboddin
gboddin / drupal_dev_lighttpd.sh
Last active May 17, 2016 14:59
drupal_dev_lighttpd
#!/bin/bash
# will start a multithreaded instance of the local installation
# for ubuntu/debian users
# apt-get install lighttpd php5-cgi
echo "Locating php-cgi :"
if which php-cgi; then
php_cgi_path=$(readlink -f `which php-cgi`)
else
exit 1
fi
@wernight
wernight / inotifyexec.py
Last active June 27, 2023 22:47
inotifywait helper that executes a command on file change (for Linux, put it in ~/bin/)
#!/usr/bin/env python
"""Use inotify to watch a directory and execute a command on file change.
Watch for any file change below current directory (using inotify via pyinotify)
and execute the given command on file change.
Just using inotify-tools `while inotifywait -r -e close_write .; do something; done`
has many issues which are fixed by this tools:
* If your editor creates a backup before writing the file, it'll trigger multiple times.
* If your directory structure is deep, it'll have to reinitialize inotify after each change.
@willurd
willurd / web-servers.md
Last active July 23, 2024 17:12
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@lampeh
lampeh / perroquet-poc.rst
Created October 16, 2012 00:13
Le perroquet: push updated data directly into varnish
@eethann
eethann / .vimrc-statusline.vim
Created December 15, 2011 17:14
vimrc segment for syntastic- and fugitive-enabled statusline.
" from https://github.com/spf13/spf13-vim/blob/master/.vimrc
if has('statusline')
set laststatus=2
" Broken down into easily includeable segments
set statusline=%<%f\ " Filename
set statusline+=%w%h%m%r " Options
set statusline+=%{fugitive#statusline()} " Git Hotness
set statusline+=\ [%{&ff}/%Y] " filetype
set statusline+=\ [%{getcwd()}] " current dir
set statusline+=%#warningmsg#
@esperlu
esperlu / mysql2sqlite.sh
Created April 27, 2011 05:46
MySQL to Sqlite converter
#!/bin/sh
# Converts a mysqldump file into a Sqlite 3 compatible file. It also extracts the MySQL `KEY xxxxx` from the
# CREATE block and create them in separate commands _after_ all the INSERTs.
# Awk is choosen because it's fast and portable. You can use gawk, original awk or even the lightning fast mawk.
# The mysqldump file is traversed only once.
# Usage: $ ./mysql2sqlite mysqldump-opts db-name | sqlite3 database.sqlite
# Example: $ ./mysql2sqlite --no-data -u root -pMySecretPassWord myDbase | sqlite3 database.sqlite