Skip to content

Instantly share code, notes, and snippets.

View janetruluck's full-sized avatar

Jane Truluck janetruluck

View GitHub Profile

Keybase proof

I hereby claim:

  • I am jaytruluck on github.
  • I am jaytruluck (https://keybase.io/jaytruluck) on keybase.
  • I have a public key whose fingerprint is EE6D DB2D DE7C F13A 7286 5374 AA88 B7AC 6EB3 67B4

To claim this, I am signing this object:

@janetruluck
janetruluck / Excon Output
Created June 6, 2014 17:46
Output for Excon debugging
excon.request
:body => #<File:/Users/jason/Projects/private/project/core/public/images/public/images/1402076353-18822-7607/item.png>
:chunk_size => 1048576
:ciphers => "HIGH:!SSLv2:!aNULL:!eNULL:!3DES"
:connect_timeout => 60
:debug_reponse => true
:debug_request => true
:debug_response => true
:expects => 200
:headers => {
@janetruluck
janetruluck / Users.java
Created February 18, 2014 03:29
Play! framework form validations
package controllers;
// Java
import java.util.*;
// Play
import play.*;
import play.mvc.*;
import play.libs.Json;
import play.data.validation.Constraints;
import play.data.Form;
import models.*;
@janetruluck
janetruluck / benchmark.rb
Created November 30, 2013 18:46
Quick benchmark for .reject with rejected array initialization in loop and out of loop
require "benchmark"
ITEMS = { :foo => "bar", :fizz => "buzz", :fazz => "bazz" }
REJECTED_ITEMS = [:foo, :fazz]
# Number of iterations
@n = 10
def with_constant
@n.times do
@janetruluck
janetruluck / app_and_db_server.sh
Last active May 26, 2020 13:49
Sets up a SINGLE linode with application and database configuration.
#!/bin/bash
## Please modify and use at your leisure!
## This script installs:
##
## -RVM
## -Ruby 1.9.3
## -Postgresql 9.2
## -Nginx
## -Postfix
@janetruluck
janetruluck / jenkins-ci-install.sh
Last active December 19, 2015 17:29
Jenkins CI server install script. Read comments at top of script for details.
#!/bin/bash
## Please modify and use at your leisure!
## This script installs:
## -Jenkins CI
## -RVM
## -Ruby 1.9.3
## -Postgresql 9.2
## -Phantom JS 1.9.0
## -Redis 2.4.16
@janetruluck
janetruluck / string_to_array.rb
Created June 12, 2013 02:40
Benchmark 100,000 items converting string to array ruby
require "benchmark"
puts Benchmark.measure {
100000.times do
"[1,2,3,4]"[1..-2].split(",")
end
}
puts Benchmark.measure {
100000.times do