Skip to content

Instantly share code, notes, and snippets.

View rawburt's full-sized avatar

Robert Peterson rawburt

View GitHub Profile
# user env
alias __git_ps1="git branch 2>/dev/null | grep '*' | sed 's/* \(.*\)/(\1) /'"
export PS1="\[\033[0;31m\][\t] \[\033[0;37m\]\W \[\033[0;36m\]\$(__git_ps1)\[\033[0;31m\]$ \[\033[0m\]"
alias ls='ls -laG'
@rawburt
rawburt / add.nisp
Last active December 6, 2016 08:01
(defun add (x y)
(+ x y))
(print (add 1 2))
# ruby implementation of https://www.smallsurething.com/implementing-the-famous-eliza-chatbot-in-python/
class Eliza
REFLECTIONS = {
"am": "are",
"was": "were",
"i": "you",
"i'd": "you would",
"i've": "you have",
"i'll": "you will",
@rawburt
rawburt / n3
Last active January 15, 2016 03:49
formatting comments
#!/usr/bin/env ruby
# Using AWS S3 to make sharing files with your friends as simple as can be...
# ... or something.
#
# Only tested on OS X.
#
# usage: n3 [put|get|list|delete|open|help]
[
@rawburt
rawburt / water
Created January 3, 2016 07:57
track your daily water intake
#!/usr/bin/env ruby
# Track your daily water intake.
#
# usage: ./water [+|-]
require "yaml"
WATER_FILE = File.expand_path("~/.water")
def dump(d); File.open(WATER_FILE, "w+") {|f| f.write YAML.dump(d) }; end
dump({}) unless File.exists?(WATER_FILE)
@rawburt
rawburt / rando
Created June 30, 2015 08:49
open a random link
ruby -r json -r net/http -e 'link=JSON.parse(Net::HTTP.get_response("smasha.ninja","/rando").body);exec("open #{link["web_url"]}")'
h2 Step #{step}
.row
.col-md-6
if previousStep
button.btn.btn-primary click="gotoStep previousStep" Back
.col-md-6
if nextStep
button.btn.btn-primary.pull-right click="gotoStep nextStep" Next
(ns shoutbox
(:use compojure
somnium.congomongo))
(mongo! :db "shoutbox")
(defn save-shout [s]
(insert! :shouts
{:text s}))
#!/bin/bash
# drop .jar's into ~/.clojure and they will be auto-loaded into the classpath
java -cp $HOME/.clojure/*: jline.ConsoleRunner clojure.main $1