Skip to content

Instantly share code, notes, and snippets.

View woodruffw's full-sized avatar
💭
איך האב מיין אייגענע צרות

William Woodruff woodruffw

💭
איך האב מיין אייגענע צרות
View GitHub Profile
pairs = gets.chomp.split.map { |p| p.split(/d/i).map(&:to_i) }
pairs.each { |s, t| puts "You rolled %s" % [*1..s].sample(t).reduce(:+) }
size, times, _ = gets.chomp.split(/d/i).map(&:to_i)
puts "You totaled %d" % [*1..size].sample(times).reduce(:+)
#!/usr/bin/env bash
# music-backup: use rsync to back ~/music up to /media/backup/music
function installed {
local cmd=$(command -v "${1}")
[[ -n "${cmd}" ]] && [[ -f "${cmd}" ]]
return ${?}
}
#!/usr/bin/env bash
# wwwbackup: back woodruffw.us files up to tarball, rotate weekly
if [[ "$(hostname)" != "athena" ]] ; then
echo "Wrong host, dummy."
exit 1
fi
shopt -s nullglob
@woodruffw
woodruffw / test
Created December 1, 2015 22:37
test
test
require 'cinch'
$COUNT = 1
module Cinch
module Plugin
module ClassMethods
def test_hook
puts self
hook :pre, :for => [:match], :method => :test_hook
@woodruffw
woodruffw / keybase.md
Created May 26, 2015 17:05
keybase.md

Keybase proof

I hereby claim:

  • I am woodruffw on github.
  • I am yossarian (https://keybase.io/yossarian) on keybase.
  • I have a public key whose fingerprint is 46C3 9716 A8F0 7E98 384E 28F7 85AE 00C5 0483 3B3C

To claim this, I am signing this object:

@woodruffw
woodruffw / screenfetch-c.html
Created March 31, 2015 21:25
screenfetch-c.html
<!-- Creator : groff version 1.22.2 -->
<!-- CreationDate: Tue Mar 31 17:15:32 2015 -->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta name="generator" content="groff -Thtml, see www.gnu.org">
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<meta name="Content-Style" content="text/css">
<style type="text/css">
/* set_window_front
On EWMH-compliant window managers, sets the _NET_WM_STATE of the given
window to _NET_WM_STATE_ABOVE to make it stay on top of all others besides
_NET_WM_STATE_FULLSCREEN. If the window manager is not EWMH-compliant,
nothing is done.
Arguments:
Display *disp - a pointer to the X display
Window wind - the window being moved to the front
*/
/* name_window
Name the given window "name" on the given display.
Arguments:
Display *disp - a pointer to the X display
Window wind - the window being named
const char *name - the name being given to the window
*/
void name_window(Display *disp, Window wind, const char *name)
{