Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am hyperbolist on github.
  • I am ericsherman (https://keybase.io/ericsherman) on keybase.
  • I have a public key ASB2UOD0PNxI_GjV26UlAXJA6jNT8tmPQx3Rpwj-xr3jZgo

To claim this, I am signing this object:

@hyperbolist
hyperbolist / myfirstlaunch.ks
Created June 11, 2015 15:32
I imagine this looks like everyone else's first kOS launch automation.
SET SHIP:CONTROL:PILOTMAINTHROTTLE TO 0.
// staging, throttle, steering, go
WHEN STAGE:LIQUIDFUEL < 0.1 THEN {
STAGE.
PRESERVE.
}
LOCK THROTTLE TO 1.
SET starting_pitch TO 80.
LOCK STEERING TO R(0,0,-90) + HEADING(90,starting_pitch).
STAGE.
#!/usr/bin/env ruby
require 'rubygems'
require 'PDFKit'
in_file=ARGV.shift
out_file=ARGV.shift
kit = PDFKit.new(File.new(in_file), :page_size => 'Letter')
pdf = kit.to_pdf
@hyperbolist
hyperbolist / secret_santa.rb
Created December 13, 2010 20:46
$ secret_santa.rb billy timmy jimmy molly mary julie anne
#!/usr/bin/env ruby
def pick_one(a)
a.delete_at(rand(a.size))
end
def pick_one_not(a, s)
index = rand(a.size)
return pick_one_not(a, s) if (a[index].eql?(s))
a.delete_at(index)
nametrans = lambda foldername: re.sub('^\[G.*ail\].', '', foldername.replace(' ', '_'))
folderfilter = lambda foldername: re.sub('^\[G.*ail\].', '', foldername.replace(' ', '_')) in ['INBOX', 'All_Mail', 'Sent_Mail', 'Follow_Up', 'Hold']
:index_old:
:fg: default
:bg: default
if header["To"] =~ /workdomain|foo|bar|baz/
header["From"] = "Work Email <work.email@workdomain.com>"
elsif header["To"] =~ /sup-devel|sup-talk/
header["From"] = "Eric Sherman <hyperbolist@gmail.com>"
end
#!/bin/sh
# edit /Applications/CrossOver.app/Contents/Info.plist
# find these lines:
# <key>CFBundleExecutable</key>
# <string>CrossOver</string>
# replace with:
# <key>CFBundleExecutable</key>
# <string>CrossOver :8</string>
#!/bin/sh
# jshebang - self-contained java "scripts" without beanshell or groovysh
#
# 1) replace the heredoc with your java "script"
# 2) name its public main class $ME
# 3) there is no step 3
#
# a quick hack tested on osx and ubuntu, but should work in any sane environment.
# also possibly of interest: http://pastebin.stonekeep.com/5351
###
" delete the buffer; keep windows {{{
" there is apparently some dispute over the best way to accomplish this
" this is what i use, though i don't recall the original source
" see http://vim.wikia.com/wiki/Deleting_a_buffer_without_changing_your_window_layout
function Kwbd(kwbdStage)
if(a:kwbdStage == 1)
let g:kwbdBufNum = bufnr("%")
let g:kwbdWinNum = winnr()
windo call Kwbd(2)
execute "bd! " . g:kwbdBufNum