Skip to content

Instantly share code, notes, and snippets.

View vangberg's full-sized avatar

Harry Vangberg vangberg

View GitHub Profile
nocompatible
Last set from ~/.vimrc
textwidth=80
nopaste
wrapmargin=0
formatoptions=croql
Last set from ~/.vim/ftplugin/ruby.vim
formatexpr=
require 'rubygems'
require 'sinatra'
module ::Haml::Filters::Maruku
end
get '/' do
"blah"
end
|--story [1]-|
---[a]------------[b]----[c]---------[d]---[e]-
jan feb mar apr may jun jul aug sep oct nov dec
-----------------------------------------------
---[2]------| |--[2]-
Cases:
[a] ends_at > today,
ends_at < starts_at
def parse_my_data
send_data "foo"
if {received_data} == "bar"
send_data "success!"
end
def incoming # or 'context incoming', nevermind.
# Send: 'exec play hello-world'
play 'hello-world'
# Send: 'wait for digit' and read return
selection = input(4)
# ..
play 'success' if selection == 4
end
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" creationComplete="guidesXML.send()">
<mx:HTTPService
id="guidesXML"
url="http://localhost:4567/guides/"
result="guideHandler(event)"
resultFormat="e4x" />
<mx:Script>
<?xml version="1.0" encoding="iso-8859-1"?>
<guides>
<guide>
<id>1</id>
<name>woo</name>
</guide>
<guide>
<id>2</id>
<name>foobar</name>
</guide>
$ irb
>> require 'harry_from_xml'
>> xml = '<menu>
<drink>
<name>Death in the Afternoon</name>
</drink>
<drink>
<name>Mojito</name>
</drink>
</menu>'
@vangberg
vangberg / dialplan.rb
Created August 28, 2008 21:22
never tested. might not work.
require 'rubygems'
require 'dm-core'
require 'ftools'
incoming do
iv = new_instant_vox
iv.handle_call
end
incoming do
#jump to another context
+another_context
play "hello-world"
end
another_context do
play "foo"
end