Skip to content

Instantly share code, notes, and snippets.

john@joran ~/bin/betas/towerfall ❯ unzip Release.zip
Archive: Release.zip
error [Release.zip]: missing 12 bytes in zipfile
(attempting to process anyway)
error [Release.zip]: attempt to seek before beginning of zipfile
(please check that you have transferred or created the zipfile in the
appropriate BINARY mode and that you have compiled UnZip properly)
(attempting to re-compensate)
inflating: Lidgren.Network.dll
inflating: MonoGame.Framework.dll
john@joran ~/code/SteamLinux git:master *❯ phpunit | head -n 4
PHPUnit 4.0.17 by Sebastian Bergmann.
You have installed PHPUnit via PEAR. This installation method is no longer
supported and http://pear.phpunit.de/ will be shut down no later than
john@joran ~/code/SteamLinux git:master *❯ which phpunit
/usr/local/bin/phpunit
john@joran ~/code/SteamLinux git:master *❯ /usr/local/bin/phpunit | head -n 4
PHPUnit 4.1.1 by Sebastian Bergmann.
@johndrinkwater
johndrinkwater / pre-commit
Created June 6, 2014 11:48
SteamLinux/.git/hooks/pre-commit
#!/usr/bin/env php
<?php
exec("phpunit --configuration .phpunit.xml", $output, $returnCode );
if ( $returnCode !== 0 ) {
$summary = array_pop( $output );
printf( "Stop `git commit`, test failed with: ( %s )\n", $summary );
exit( 1 );
}
exit( 0 );
<?php
class SteamLinuxTest extends PHPUnit_Framework_TestCase
{
public function testFileExists( )
{
// Trying to get dataProvider to work with depends in phpunit requires some serious magic
$filePath = __DIR__ . DIRECTORY_SEPARATOR . 'GAMES.json';
$this->assertFileExists( $filePath );
@johndrinkwater
johndrinkwater / gist:3c1926bf0903cf071ad3
Created June 10, 2014 00:21
find -name episode.txt | xargs -n 1 head -n 11
RECORDED: 2013-05-24
PUBLISHED: 2013-05-00
TITLE: Our Introduction
SEASON: 01
EPISODE: 01
DURATION: 01:46:35
DESCRIPTION: Our launch podcast introducing ourselves, discussing recent history of the group, steam on linux and gaming. We intend to make a 45 minute to an hour cast every fortnight, this longer episode was expected as we find our footing in making these, please ‘tolerate’ our inexperience and contribute to improve it!
HOSTS: @ValiantCheese, John (@johndrinkwater), @swordfischer
GUESTS:
ADDITIONAL:
Uploading new ranking score of 60666
Not uploading to leaderboard because no games have yet been played this season. score: 60666
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xe9281b40 (LWP 15487)]
0x0823c4d6 in ?? ()
(gdb) bt
#0 0x0823c4d6 in ?? ()
#1 0x084dfe6a in ?? ()
#2 0x0849610c in ?? ()

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"

Results

@johndrinkwater
johndrinkwater / gist:65d91dedbc856babf5a8
Last active August 29, 2015 14:03
For smaller repos, with little changes, merge commits are mostly noise. Let’s try to minimise that while still correctly tracking authorship.
Use the instructions at https://gist.github.com/piscisaureus/3342247 to have `git fetch` pull down all
active Pull Requests into your local git. Suffice to say, add
`fetch = +refs/pull/*/head:refs/remotes/origin/pr/*` under [remote "origin"] in your project’s
`.git/config` file
To be able to use git with the pr, you have to checkout it out first (no fucking idea why), but at
least we can capture some metadata while we are there.
`git checkout pr/1`
(this would be a great place to suggest doing a remaster in case they produced this commit from an
AppID : 234920, change number : 593277/593277, token 3745192639212362146, last change : Thu Jul 10 07:03:13 2014
"234920"
{
"common"
{
"name" "Dyscourse"
"type" "Game"
"ReleaseState" "prerelease"
"oslist" "windows,macos,linux"
"logo" "50674c891f5c8e0bc43e85ca97f4df23e26624ad"
@johndrinkwater
johndrinkwater / pre-commit
Created July 14, 2014 19:32
Put this in .git/hooks/ for SteamLinux and it wont let you create a commit if the change would be rejected
#!/usr/bin/env php
<?php
exec("phpunit --configuration .phpunit.xml", $output, $returnCode );
if ( $returnCode !== 0 ) {
$summary = array_pop( $output );
printf( "Stop `git commit`, test failed with: ( %s )\n", $summary );
exit( 1 );
}
exit( 0 );