Skip to content

Instantly share code, notes, and snippets.

View pjf's full-sized avatar

Paul Fenwick pjf

View GitHub Profile
#!/usr/bin/perl -w
use 5.010;
use strict;
use warnings;
use autodie qw( :all );
use WebService::Beeminder;
use Config::Tiny;
# use Smart::Comments;
# Get our beeminder auth token.
@pjf
pjf / MWDF-Tileset-Diffs.diff
Created November 15, 2013 07:11
Differences between the master raw files and tilesets in Masterwork Dwarf Fortress
This file has been truncated, but you can view the full file.
Finding potential tileset differences...
Excluding: inorganic_stone_gem.txt
Known display tags are: COLOR CREATURE_SOLDIER_TILE CREATURE_TILE DEAD_SAPLING_COLOR DEAD_SAPLING_TILE DEAD_SHRUB_COLOR DEAD_SHRUB_TILE DEAD_TREE_COLOR DEAD_TREE_TILE DISPLAY_COLOR GLOWCOLOR GLOWTILE GRASS_COLORS GRASS_TILES ITEM_SYMBOL PICKED_COLOR PICKED_TILE SAPLING_COLOR SAPLING_TILE SHRUB_COLOR SHRUB_TILE STATE_NAME_ADJ TILE TREE_COLOR TREE_TILE
--- /home/pjf/cygwin/pjf/cvs/MWDF/Dwarf Fortress/raw/objects/creature_amphibians.txt 2013-02-25 20:58:56.000000000 +1100
+++ /home/pjf/cygwin/pjf/cvs/MWDF/MasterworkDwarfFortress/graphics/ASCII/raw/objects/creature_amphibians.txt 2013-11-07 14:08:42.404141240 +1100
@@
@pjf
pjf / .bash_prompt
Created January 3, 2014 02:05
How pjf makes his prompt so awesome. I actually put the colours in ~/.bash_colours and source that in, but I've in-lined it here for easy gisting. ;)
# Reset
Color_Off='\[\e[0m\]' # Text Reset
# Regular Colors
Black='\[\e[0;30m\]' # Black
Red='\[\e[0;31m\]' # Red
Green='\[\e[0;32m\]' # Green
Yellow='\[\e[0;33m\]' # Yellow
Blue='\[\e[0;34m\]' # Blue
@pjf
pjf / gist:8231962
Last active January 2, 2016 01:39
The curious matter of finding a given merge

My problem:

I'm working on a project where upstream doesn't use source control of any sort. Yes, that's exactly the same reaction I had as well.

I keep track of their releases on a branch named upstream. When new releases are made, I add them to this branch as a single commit, so at least I know what changed (in bulk) from the last release.

My changes (usually!) end up in the official releases, but because they don't use source control, my commits never do. Hence I want to find all the commits I've made since the last merge, as an "approximation" of what's changed between my release and theirs. Simple git log A..B isn't what I want here.

So, here's the network graph. I want to find the last point on master where upstream was merged in. In this case, that's 9039b22b .

@pjf
pjf / rickroll.pl
Created January 22, 2014 12:24
Rickroll cmdline utility
#!/usr/bin/perl -w
use 5.010;
use strict;
use warnings;
use autodie;
use WWW::Twilio::API;
my $lucky_person = shift || die "Usage: $0 phone-number";
my $rick = WWW::Twilio::API->new(
# Usage: {% pullquote : Here's some pullquote text. %}
module Jekyll
class PullQuote < Liquid::Tag
# (Options) : (Message)
Syntax = /^(.*?)\s*:\s*(.*)/
def initialize(tag_name, markup, tokens)
super
There was a staffer named erry
Who helped on hash-freenode
She heard my humble cries for help;
While she was hacking code.
So now I have my favourite nick
That I've wanted for six years
And it's all due to erry's help!
For that I give a cheer!
== Permitted, but not defined (BUGS!) ==
- [ ] ACID_AMMO (entity_dwarf_evil.txt)
- [ ] ARMORPLATE (entity_dwarf_evil.txt entity_human.txt)
- [ ] BADTHOUGHTS_KOBOLD (entity_kobold_camp.txt)
- [ ] BAYONET (entity_default.txt entity_dwarf_evil.txt)
- [ ] BAYONET_2 (entity_dwarf_evil.txt entity_human.txt)
- [ ] BAYONET_AIRGUN (entity_dwarf_evil.txt)
- [ ] BAYONET_RIFLE (entity_dwarf_evil.txt)
@pjf
pjf / push
Created November 8, 2014 22:55
#!/usr/bin/perl
use 5.010;
use strict;
use warnings;
use autodie qw(:all);
use IPC::System::Simple qw(capturex systemx);
my $upstream = $ARGV[0] || "pjf";
my $branch = capturex(qw(git rev-parse --abbrev-ref HEAD));
@pjf
pjf / gist:d203eec5fb3dc61b5fc9
Last active August 29, 2015 14:09
CKAN release announcement

Introduction

When I first discovered Kerbal Space Program, I found it was great. And then I discovered the mods; and they turned a great game into an amazing one.

About 70 mod installs later, I realised that installing mods was time-consuming, and error-prone. Each mod seemed to have its own set of dependencies, its own way of being packaged, its own way of being installed. Worst of all, some mods would conflict with each other, something I'd often discover after it was already too late.

I saw the same problems were plaguing mod authors as well. Users would be asking for help because they had installed the wrong version, or were experiencing conflicts with existing mods.