Skip to content

Instantly share code, notes, and snippets.

View HNygard's full-sized avatar

Hallvard Nygård HNygard

View GitHub Profile
@HNygard
HNygard / phpunit.config.xml
Created March 19, 2012 14:40
PHPUnit XML
<?xml version="1.0" encoding="utf-8" ?>
<phpunit>
<testsuite name='MyTestSuite'>
<directory prefix='X' suffix='.php'>../../</directory>
</testsuite>
</phpunit>
@HNygard
HNygard / gist:1033457
Created June 18, 2011 20:05
GC2VOPR Forus ? #3
<?php
function test($s, $t, $f, $c, $e, $h, $a)
{
return ($c.$a.$c.$h.$e) == ($s.$t.$f)+($t.$t.$f)+($t.$f.$t.$c);
}
$unna = 1;
for($c = 2-$unna; $c <= 2+$unna; $c++) // Ikke mer enn 3 km unna
for($h = 3-$unna; $h <= 3+$unna; $h++) // Ikke mer enn 3 km unna
#!/bin/bash
# Rename file to the name of parent folder
# Install nautilus-actions:
# http://ubuntuforums.org/showthread.php?t=91377
# Only support 3 character file extention
extention=${1:(-4):4}
#echo $extention
#!/bin/bash
#Put this file in ~/.gnome2/nautilus-scripts directory
#Open the current directory of Nautilus in git cola
if [ "x$NAUTILUS_SCRIPT_CURRENT_URI" = "x" ]; then
workdir=$(pwd) #FIXME
else
workdir=$(echo $NAUTILUS_SCRIPT_CURRENT_URI| sed 's/file:\/\///g')
fi
#!/bin/bash
#Put this file in ~/.gnome2/nautilus-scripts directory
#Open the selected directory of Nautilus in git cola
workdir=$(echo $NAUTILUS_SCRIPT_SELECTED_FILE_PATHS)
git-cola -r $workdir
#Comment the previous line and uncomment the next line,
#If want to keep git cola in English even if your system use an other language
#LANG=C && git-cola -r $workdir && LANG=fr_FR.UTF-8