Skip to content

Instantly share code, notes, and snippets.

git ls-files | rsync -avzn --delete --files-from=/dev/stdin . jupiter:proj/ir
@lgrz
lgrz / phpman
Last active December 29, 2015 15:19
#!/bin/bash
BROWSER="links"
PHPDOC="/path/to/doc/php/"
if [ "$#" -ne 1 ]; then
echo "usage: phpman class|function"
exit
fi
@lgrz
lgrz / gist:6987731
Created October 15, 2013 07:13
List of dtrace scripts
/usr/bin/bitesize.d
/usr/bin/cpuwalk.d
/usr/bin/creatbyproc.d
/usr/bin/dappprof
/usr/bin/dapptrace
/usr/bin/diskhits
/usr/bin/dispqlen.d
/usr/bin/dtruss
/usr/bin/errinfo
/usr/bin/execsnoop
@lgrz
lgrz / gist:6560377
Created September 14, 2013 09:10
Ghetto progress with dd
while [[ 1 ]]; do kill -USR1 `pgrep ^dd$`; sleep 2; done
@lgrz
lgrz / gist:6558340
Created September 14, 2013 02:25
How to make your eyes bleed
search: (^ +)(if|else|do|while|switch|for) (.*)?{
replace: $1$2 $3\n$1{
@lgrz
lgrz / ExactOne.graffleshapes
Created August 14, 2013 12:01
Exactly one relation for OmniGraffle place file in ~/Library/Application Support/OmniGraffle/Shapes
{
arrowheads = (
{
Gap = 0.5;
LineGap = 1.0;
Name = ExactOne;
Path = {
elements = (
{element = MOVETO; point = "{12, 6}"; },
{element = CURVETO; control1 = "{3, 6}"; control2 = "{3, -6}"; point = "{12, -6}"; },
@lgrz
lgrz / post.php
Created February 17, 2013 11:50
Sample multipart/form-data POST with non-ASCII chars.
<?php
// utf-8 is the default setting, just to be sure for this example.
ini_set('default_charset', 'UTF-8');
if (count($_POST)) {
var_dump($_POST);
}
?>
@lgrz
lgrz / preload-font.js
Created September 12, 2012 00:23
Preload font example
// Preload Qucksand Bold
var preload = $('<div>hello</div>').css({
'clip': 'rect(1px, 1px, 1px, 1px)',
'font-family': 'Quicksand Bold',
'position': 'absolute'
});
$('body').prepend(preload);
@lgrz
lgrz / composer.sh
Created August 8, 2012 00:16
Wrapper script for composer
#!/usr/bin/env sh
#
# A shell wrapper for composer.phar
#
#set -e
# Do we have PHP?
PHP=$(which php)
@lgrz
lgrz / deploy.rb
Created August 7, 2012 00:43
Collection of Capifony tasks
after "deploy:restart", "deploy:cleanup"
after "deploy:setup", "symfony:setup:parameters_init"
# Clear the cache before the cache:warmup task is run. The cache directory is
# shared, that way setting ACL's only happens once and we avoid the use of
# sudo
before 'deploy:finalize_update', 'symfony:cache:remove'
namespace :symfony do
namespace :cache do