Skip to content

Instantly share code, notes, and snippets.

@voidlily
voidlily / universe.clj
Last active Jan 30, 2017
Calculate prereqs for a universe in ITRTG
View universe.clj
#!/usr/bin/env lein-exec
;;; Calculator for manual creations given a CC value
;;; Based on numbers from
;;; http://www.kongregate.com/forums/2874-idling-to-rule-the-gods/topics/453555-creating-a-universe#posts-9414071
;;;
;;; Usage: universe.clj <cc> <number of universes>
(require '[clojure.pprint :refer (print-table)])
View keybase.md

Keybase proof

I hereby claim:

  • I am voidlily on github.
  • I am voidlily (https://keybase.io/voidlily) on keybase.
  • I have a public key whose fingerprint is 4B1E A1C7 B11F 4C68 D8C8 BC84 D934 B57D E289 5156

To claim this, I am signing this object:

@voidlily
voidlily / clickerheroes.clj
Last active Aug 29, 2015
Clicker Heroes ancient levels calculator
View clickerheroes.clj
#!/usr/bin/env lein-exec
;;; Ancient calculator based on the following links
;;;
;;; https://www.dropbox.com/s/pu0wem11sn13qki/ClickerHeroes-Ideal.pdf?dl=0
;;; https://www.reddit.com/r/ClickerHeroes/comments/339m3j/thumbs_up_the_rules_of_thumb/
;;;
;;; Usage: clickerheroes.clj <siylatas level> <optimal zone>
;;; optimal zone is the zone where your gilded hero stops one shotting
;;; early game is until atlas
View gist:624bc96073053d99f627
alias tmux-alias="tmux new-session -A -s foo"
# Usage
tmux-alias # Attaches to existing "foo" session or makes a new "foo" session in the current directory
tmux-alias -c /tmp # Attaches to existing "foo" session or makes a new "foo" session in /tmp
View keybase.md

Keybase proof

I hereby claim:

  • I am voidlily on github.
  • I am voidlily (https://keybase.io/voidlily) on keybase.
  • I have a public key whose fingerprint is BBF4 6311 39A1 AE78 5DF8 784F 10D8 CF3B 5F7E EB02

To claim this, I am signing this object:

View gist:7797385
(defn rent [initial year]
"Calculates the rent for a given year. Assumes 1.9% increase yearly based on SF rent control."
(* initial (Math/pow 1.019 year)))
(defn rent-seq [price]
"Generates a lazy infinite sequence of rent increases based on a given base price."
(map #(rent price %) (iterate inc 0)))
; Get the projected rent increases for living at a place for 10 years
(->> (rent-seq 2000) (take 10) (map #(format "%.2f" %)))
View gist:3691733
# incorrect
time = Time.zone.parse('2011-11-06T01:00:00')
=> Sun, 06 Nov 2011 01:00:00 PDT -07:00
time.advance(hours: 1).beginning_of_hour
=> Sun, 06 Nov 2011 01:00:00 PDT -07:00
# correct usage
time.utc.advance(hours: 1).change(min: 0).in_time_zone
View qwantz404.rb
# Sinatra
error 404 do
"WHAT THE HELL DID YOU DO [PERSON'S NAME HERE]?? YOU BROKE IT, PEOPLE ARE DYING, WHYY"
end
View Gemfile
source 'http://rubygems.org'
gem 'sequel'
gem 'rspec'
gem 'sqlite3'
View gist:2596267
foo = lambda do |a|
b = a + 5
b
end
b = 2
foo.call(b)
=> 7
b
You can’t perform that action at this time.