Skip to content

Instantly share code, notes, and snippets.

View nbomberger's full-sized avatar

Nathaniel Bomberger nbomberger

View GitHub Profile
#!/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
<?php
/**
* SplClassLoader implementation that implements the technical interoperability
* standards for PHP 5.3 namespaces and class names.
*
* http://groups.google.com/group/php-standards/web/final-proposal
*
* // Example which loads classes for the Doctrine Common package in the
* // Doctrine\Common namespace.

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
<?php
namespace Renoir\AggregationBundle;
/**
* Abstract client to use for each Client
*
* Example location: src/Renoir/AggregationBundle/AbstractClient.php
**/
@nbomberger
nbomberger / autoloader.php
Last active December 16, 2015 18:08 — forked from adriengibrat/l.php
PSR-0 Compliant autoloader.
/**
* Small PSR-0 compliant autloader
*/
<?php
set_include_path(get_include_path().PATH_SEPARATOR.__DIR__);
spl_autoload_register(
function ($c) {
@include preg_replace('#\\\|_(?!.*\\\)#','/',$c).'.php';
}
);
@nbomberger
nbomberger / template-basic
Created May 4, 2013 21:58 — forked from Gen2ly/template-basic
This is a Bash script template.
#!/bin/bash
# Description of script
# Display usage if no parameters given
if [[ -z "$@" ]]; then
echo " ${0##*/} <input> - description"
exit
fi
# Required program(s)
@nbomberger
nbomberger / template
Last active December 17, 2015 00:09 — forked from Gen2ly/template
This is a Bash script template with colors. I replaced the '\e' with '\x1B' to make it work with OSX's terminal colors.
#!/bin/bash
# Description of script
# Required program(s)
req_progs=(prog1 prog2)
for p in ${req_progs[@]}; do
hash "$p" 2>&- || \
{ echo >&2 " Required program \"$p\" not installed."; exit 1; }
done
# configuration for osx clipboard support
set-option -g default-command "reattach-to-user-namespace -l sh"
git remote add --track master upstream git://github.com/upstreamname/projectname.git
@nbomberger
nbomberger / README.md
Last active December 18, 2015 06:09 — forked from xoebus/README.md

imsg

Send iMessages from the Command Line


Install

Just run the following in your shell: