Skip to content

Instantly share code, notes, and snippets.

@xiian
xiian / gist:4998c569b5684af026d2
Created January 9, 2015 19:41
Set up all existing branches to rebase instead of merge
#!/bin/bash
git config branch.autosetuprebase always;
for BRANCH in `git for-each-ref --format='%(refname)' refs/heads/ | sed 's~refs/heads/~~g'`; do
git config branch.$BRANCH.rebase true;
echo "$BRANCH now set up for rebasing"
done
@xiian
xiian / zf_svn_fix.sh
Created March 16, 2011 18:40
Zend Framework SVN server change fixer
# Run in base path of your ZF checkout
# Will update the UUIDs without needing to re-check out everything.
find . -name 'entries' | xargs perl -pi -e 's/44c647ce-9c0f-0410-b52a-842ac1e357ba/1589e24e-76c8-4bf2-8f94-c092ebc2bf4e/g'
@xiian
xiian / get_dmg_name.sh
Created July 30, 2011 23:41
Rename DMG files to the actual disk image name
#!/bin/bash
# Mount the disk image and parse out the output
OUTPUT=`hdid $1 | grep /Volumes | sed 's~^\([^ ]*\) .*Volumes/\(.*\)~\1 | \2~g'`
VOLNAME=`echo $OUTPUT | sed 's~^.*| ~~g'`
DEVICE=`echo $OUTPUT | sed 's~^\([^ ]*\).*~\1~g'`
# Rename the disk image
echo "Renaming $1 to $VOLNAME.dmg"
mv $1 "$VOLNAME.dmg"
@xiian
xiian / hack.sh
Created March 31, 2012 18:07 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
10gen.com | 10gen | 115 | 438
1800postcards.com | 1800Postcards.com | 498 | -282
1938news.com | 1938 News | 386 | -24
20x200.com | 20x200 | 526 | -686
2findlocal.com | 2findLocal | 85 | 551
72Lux.com | 72Lux | 284 | 82
8coupons.com | 8coupons | 424 | -73
accompl.sh | Accompl.sh | 415 | -61
acquaintable.com | Acquaintable | 92 | 514
adafruit.com | Adafruit | 447 | -121

Keybase proof

I hereby claim:

  • I am xiian on github.
  • I am tomsartain (https://keybase.io/tomsartain) on keybase.
  • I have a public key whose fingerprint is 41FE 0799 3FCD ACFD 3EE6 7354 D3AA 072A 66C5 8A41

To claim this, I am signing this object:

@xiian
xiian / test.php
Created November 18, 2019 15:06
Test that the composer autoloader can find every class given in a file
<?php
function main()
{
$classnames = file(realpath(__DIR__) . '/classnames.txt', FILE_IGNORE_NEW_LINES);
$cnt = 0;
$loader = require realpath(__DIR__) . '/vendor/autoload.php';