Skip to content

Instantly share code, notes, and snippets.

@beatrichartz
beatrichartz / gist:a75a3362d5d712daae49751898606950
Created May 30, 2021 04:16
TDD from the ground up: A failing test
it('should fail', () => {
})
Mon Jan 7 03:25:40 UTC 2019

Keybase proof

I hereby claim:

  • I am beatrichartz on github.
  • I am beatrichartz (https://keybase.io/beatrichartz) on keybase.
  • I have a public key ASDnfHzijyPl2VnNDJrmAjvZ3UqjGzx-UTxP_uXiokUgiQo

To claim this, I am signing this object:

alias newpassword='</dev/urandom gtr -dc "0-9a-zA-Z\-_.,:;!?@$%&*(){}[]#|<>" | head -c $(gshuf -i 32-64 -n 1); echo ""'
@beatrichartz
beatrichartz / cap_test.go
Created February 25, 2015 15:14
Difference for capacity
package captest
import "testing"
func WithCap() {
sl := make([]int, 500, 1000)
for i := 0; i < 1000; i++ {
if i < 500 {
sl[i] = i
} else {
Hash.new{|h,k| h[k] = Hash.new(&h.default_proc) }
func main() {
m = martini.Classic()
s = subrouter.Extend(m) // returns subrouter.Router or similar
// possible additional uses: Subdomains, Methods etc
// s.Subdomain("admin")
// subrouter extends martini with more routing patterns
@beatrichartz
beatrichartz / gist:5968572
Last active December 19, 2015 14:19
Picky Bug Report
require 'picky'
Shoe = Struct.new(:id, :color, :name)
shoes_index = Picky::Index.new(:shoes) do
category :color
category :name
end
shoes_search = Picky::Search.new(shoes_index)
"&&ERROR&&["here", "comes", "the", "data"]"
helpers Sinatra::AssetHelpers
mustache_view_helpers Sinatra::AssetHelpers