Skip to content

Instantly share code, notes, and snippets.

@dopiaza
dopiaza / convert-fla-to-png.jsfl
Created November 23, 2013 13:57
Batch convert .fla to .png, rescaling as we go
// Based on Dan Catt's https://github.com/revdancatt/CAT422-glitch-location-viewer/blob/master/tools/convert-fla-to-png.jsfl
// Updated by David Wilkinson (@dopiaza):
// - scale fla before exporting as png
// - close file if exception thrown
// Open a folder of fla files, and then output them in a parallel
// folder called "output"
//
// This is very rough and ready and needs babysitting for the files
// that don't work.
@dopiaza
dopiaza / slackpost
Created September 5, 2013 12:33
Post a message to a Slack channel
#!/bin/bash
# Usage: slackpost <token> <channel> <message>
# Enter the name of your slack host here - the thing that appears in your URL:
# https://slackhost.slack.com/
slackhost=PUT_YOUR_HOST_HERE
token=$1
@dopiaza
dopiaza / post-update-slack
Created September 5, 2013 12:35
Git post-update commit hook to post a message to a Slack channel. Uses https://gist.github.com/dopiaza/6449505
#!/bin/bash
# This script is designed to be called from a git post-update hook
# Typical usage
# In your post-update hook, the first parameter is the branch ref. So in post-update, you would
# invoke this script something like this:
# /usr/local/bin/post-update-slack $1 <branch to match> <token> <channel>
# The script will only post to slack if the branch being updated matches the one listed as <branch to match>
# Use "any" to match any branch (hopefully you don't have a branch called "any")
@dopiaza
dopiaza / keybase.md
Created September 28, 2016 14:48
keybase.md

Keybase proof

I hereby claim:

  • I am dopiaza on github.
  • I am dopiaza (https://keybase.io/dopiaza) on keybase.
  • I have a public key ASAgaiFxJztGO5KFzEqXp-kxz5Gi4pjhhLPPyxr47RGMlAo

To claim this, I am signing this object:

@dopiaza
dopiaza / GlitchCalender.php
Created December 7, 2014 09:57
PHP class to get the the current game date for the much-missed game Glitch
<?php
namespace Lumen\Glitch\CalendarBundle\Service;
class GlitchCalendar
{
private $timezone;
private $epoch;
private $daysInYear;