Skip to content

Instantly share code, notes, and snippets.

View jbz's full-sized avatar

J.B. Zimmerman jbz

View GitHub Profile
@jbz
jbz / gist:1911631
Created February 25, 2012 23:28
Los Angeles Class Inform Layout
"SubMap" by "The Custodian"
When play begins, say "Welcome to a super-sketchy notional Los Angeles Class attack submarine, the USS Aardvark!"
Chapter 0 - Setup
Forward is a direction. The opposite of forward is aft.
Index map with Forward mapped as east.
Aft is a direction. The opposite of aft is forward.
Index map with aft mapped as west.
@jbz
jbz / gist:1903401
Created February 24, 2012 20:05
Glow
To set the light level:
let arealight be 0cp;
let lights be the list of luminous things;
let litdevices be the list of luminous devices;
add litdevices to lights;
repeat with luminant running through lights:
say "LUMOS - [luminant]: [candlepower of luminant].";
now arealight is arealight plus candlepower of luminant;
say "[arealight].";
@jbz
jbz / gist:1895343
Created February 23, 2012 22:12
Blasting test
At the time when an explosion occurs:
repeat with activeMunition running through exploding explosives:
if the activeMunition is an ID bomb:
if the location of the activeMunition is the location:
say "There is a bright flash and nearly-ultrasonic whine as the ID Bomb discharges its capacitor through its radio chip! You feel a slight tickle in your skull from your dead Mit-Klein bottle circuits. The lights flicker.";
now the player is suspect;
now the activeMunition is exploded;
otherwise:
say "The lights flicker very slightly. In the distance, you hear murmuring.";
otherwise if the activeMunition is the Blasting Charge:
@jbz
jbz / gist:1887609
Created February 22, 2012 21:44
Bombs
An ID Bomb is a kind of thing. An ID Bomb is portable. An ID Bomb can be disarmed, armed or dead. An ID Bomb is disarmed. The description of an ID Bomb is "[if disarmed]A small home-made device consisting of the flash and capacitor from a disposable camera, the radio chip from a disposable cell phone and a small homebrew timing circuit. It can be armed using its single button.[otherwise if armed]The LED labelled 'ARMED' is blinking green at increasingly shorter intervals.[otherwise]This ID Bomb looks slightly scorched and smells of burnt plastic."
In the backpack are ten ID Bombs.
At the time when the ID Bomb detonates:
say "There is a bright flash and nearly-ultrasonic whine as the ID Bomb discharges its capacitor through its radio chip![line break]";
now the player is suspect;
now the noun is dead.
The Blasting Charge is portable. The Blasting Charge can be safe or fuzed. The Blasting Charge is safe. The Blasting Charge can be set or unset. The Blasting Charge is unset. The description of the B
@jbz
jbz / chef.rb
Created February 1, 2012 19:25 — forked from coderanger/chef.rb
include_recipe "collectd"
class ChefCollectdPluginReportHandler < Chef::Handler
def report
Chef::Log.info('Running collectd hander')
node[:last_success_time] = Time.now.to_f
node[:error_count_since_success] = 0
node.save
end
end
@jbz
jbz / deploy_revision before_migrate
Created January 27, 2012 18:29
Bundler error inside deploy_revision before_migrate
before_migrate do
if app['main']['uses_bundler']
link "#{release_path}/vendor/bundle" do
to "#{app['main']['deploy_to']}/shared/vendor_bundle"
end
common_groups = %w{development test cucumber staging production}
execute "bundle install --deployment --without #{(common_groups -([app['main']['rails_env']])).join(' ')}" do
ignore_failure true
cwd release_path
environment ({'LANG' => 'en_US.UTF-8'})
@jbz
jbz / example attribs file
Created January 6, 2012 17:45
Setting up chef-client using userdata bootstrap scripts
{
"run_list": [
"recipe[chef-client::config]",
"recipe[chef-client::service]",
"recipe[chef-client::delete_validation]",
"recipe[runit]",
"role[locke-validation-app]"
],
"chef_client": {
"server_url": "https://api.opscode.com/organizations/mdsol",
@jbz
jbz / ebs_raid.rb
Created September 27, 2011 21:31 — forked from tnine/ebs_raid.rb
Ebs raid mounting. Links to this jira issue http://tickets.opscode.com/browse/CHEF-2275
include Opscode::Aws::Ec2
#Auto locates and attached ebs devices based on the data bag they reside in. The following test cases need to be performed
# Create multiple resources with new node: PASS
#
# Re-attach multiple resources after a reboot: PASS
#
# Create resources across 2 runs. First run creates first raid set, second run re-attaches then creates: PASS
#
@jbz
jbz / ebs_raid6_provider.rb
Created September 27, 2011 21:31 — forked from fujin/ebs_raid6_provider.rb
aws_ebs_raid6 lwrp
include Chef::Mixin::Command
action :create do
size = new_resource.size
volumes = new_resource.volumes.times.map{|i| (i == 0 ? "/dev/sdf" : "/dev/sdf#{i}") }
setra = new_resource.blockdev_setra
volume_group = new_resource.volume_group
logical_volume = new_resource.name
mdadm_device = new_resource.mdadm_device
mount_point = new_resource.mount_point
@jbz
jbz / rsyslog::client.rb
Created August 8, 2011 18:06
rsyslog remote logging
# Recipe:: client
#
# Copyright 2010, Medidata Solutions Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#