Skip to content

Instantly share code, notes, and snippets.

@johndalton
johndalton / bang.rb
Created December 1, 2011 11:43
Bang! A simple Purugin plugin for Minecraft…
class BangPlugin
include Purugin::Plugin
description 'Bang', 0.1
def on_enable
public_command('bang', 'Cause explosion at target coords.', '/bang') do |me, *args|
me.world.createExplosion(me.target_block.location, 2, true)
end
public_command('flash', 'Cause lightning strike at target coords.', '/flash') do |me, *args|
@johndalton
johndalton / gist:1720126
Created February 1, 2012 23:24
TTYtter 2.0.0b4 stuck
TTYtter> -- routine refresh (effpause = 60, 1 to next dm) Wed Feb 1 23:33:49 2012
-- sorry, nothing to display.
-- last_id 164687531286331392, fetch_id 164687394686242817, rollback 164687531286331392
-- (250 cached)
-- sorry, no new direct messages.
-- dm bookmark is 163081705014575105.
TTYtter> -- routine refresh (effpause = 60, 4 to next dm) Wed Feb 1 23:34:52 2012
-- sorry, nothing to display.
-- last_id 164687531286331392, fetch_id 164687394686242817, rollback 164687531286331392
-- (250 cached)
@johndalton
johndalton / gist:3798178
Created September 28, 2012 06:03
caldav_kqueue respawning on OSX Mountain Lion
2012-09-28 15:59:57+1000 [-] [notifications] 2012-09-28 15:59:57+1000 [-] Log opened.
2012-09-28 15:59:57+1000 [-] [notifications] 2012-09-28 15:59:57+1000 [-] twistd 12.0.0 (/System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python 2.7.2) starting up.
2012-09-28 15:59:57+1000 [-] [notifications] 2012-09-28 15:59:57+1000 [-] reactor class: twext.internet.kqreactor.KQueueReactor.
2012-09-28 15:59:57+1000 [-] [notifications] 2012-09-28 15:59:57+1000 [-] AMPPushNotifierFactory starting on 62311
2012-09-28 15:59:57+1000 [-] [notifications] 2012-09-28 15:59:57+1000 [-] InternalNotificationFactory starting on 62309
2012-09-28 15:59:57+1000 [-] [notifications] 2012-09-28 15:59:57+1000 [-] set uid/gid 93/93
2012-09-28 15:59:57+1000 [-] [notifications] 2012-09-28 15:59:57+1000 [-] Traceback (most recent call last):
2012-09-28 15:59:57+1000 [-] [notifications] 2012-09-28 15:59:57+1000 [-] File "/usr/bin/twistd", line 14, in <module>
2012-09-28 15:59:57+1000 [-] [notifications
D, [2013-05-15T20:15:07.836205 #6104] DEBUG -- : API call path: "dna", data: {}
E, [2013-05-15T20:15:07.968689 #6104] ERROR -- : Failed to fetch DNA: Waiting for instances to be ready: [nil]: {"instance_ids"=>[nil]}
E, [2013-05-15T20:15:07.969028 #6104] ERROR -- : Got an exception: API request failed: RestClient::ServiceUnavailable: 503 Service Unavailable
D, [2013-05-15T20:15:07.969380 #6104] DEBUG -- : /usr/local/ey_resin/ruby/lib/ruby/gems/1.8/gems/rest-client-1.6.7/lib/restclient/abstract_response.rb:48:in `return!'
/usr/local/ey_resin/ruby/lib/ruby/gems/1.8/gems/rest-client-1.6.7/lib/restclient/request.rb:230:in `process_result'
/usr/local/ey_resin/ruby/lib/ruby/gems/1.8/gems/rest-client-1.6.7/lib/restclient/request.rb:178:in `transmit'
/usr/local/ey_resin/ruby/lib/ruby/1.8/net/http.rb:543:in `start'
/usr/local/ey_resin/ruby/lib/ruby/gems/1.8/gems/rest-client-1.6.7/lib/restclient/request.rb:172:in `transmit'
/usr/local/ey_resin/ruby/lib/ruby/gems/1.8/gems/rest-client-1.6.7/lib/restclient/reques
@johndalton
johndalton / gist:5682973
Created May 31, 2013 04:39
Twitter bots repeatedly favouriting tweets as a way to generate notifications and get followers?
>>> @Rementer_07035 just favorited @johndalton's tweet: "I wouldn't even know who Tom Waterhouse was if not for all the whingeing. You interfere with sportsball at your peril in this country."
u2> <keithpitt> Get a logo designed in the style of a Japanese TV Show on @MicrolancerBeta https://www.microlancer.com/explore/logo-design/1114-logo-design-for-tv-show/preview/7229
>>> @Rementer_07035 just unfavorited @johndalton's tweet: "I wouldn't even know who Tom Waterhouse was if not for all the whingeing. You interfere with sportsball at your peril in this country."
>>> @Rementer_07035 just favorited @johndalton's tweet: "I wouldn't even know who Tom Waterhouse was if not for all the whingeing. You interfere with sportsball at your peril in this country."
u3> <%BrionyKidd> RT @AWG_1: We were at @ScreenNSW & @ScreenAustralia's #fword female storytelling @vivid_ideas event on Wed - if you missed it: http://www.youtube.com/user/ScreenNSW/videos
>>> @Rementer_07035 just unfavorited @johndalton's tweet: "I wouldn't ev
<html>
<head>
<title>OMGCIRCLES!!1!</title>
</head>
<body>
<canvas id="myCanvas" width="800" height="600">
Fallback content, in case the browser does not support Canvas.
</canvas>
<script>
var myCanvas, context;
#
# This file should be in .../cookbooks/database/templates/default/database.yml.erb
#
<%= @environment %>:
adapter: <%= @adapter %>
database: <%= @database %>
username: <%= @username %>
password: <%= @password %>
host: <%= @host %>

Keybase proof

I hereby claim:

  • I am johndalton on github.
  • I am johndalton (https://keybase.io/johndalton) on keybase.
  • I have a public key whose fingerprint is 9E62 FCC1 C98B 912A 04BE 007D 4650 CB10 09AC D17D

To claim this, I am signing this object:

set guifont=Liberation\ Mono:h17.00
set mouse=a
set modeline
set ruler
set showmode
set autoindent
set termencoding=utf-8
set window=37
colorscheme darkblue
#!/bin/bash
ksp="$HOME/Library/Application Support/Steam/SteamApps/common/Kerbal Space Program/KSP.app/Contents"
unity="/Applications/Unity/Unity.app/Contents/PlaybackEngines/MacStandaloneSupport/Variations/macosx64_nondevelopment_mono/UnityPlayer.app/Contents"
transfer() {
# Take an optional destination argument in case the destination file has a different name.
if [ "Z$2" != "Z" ]
then
dest=$2