Skip to content

Instantly share code, notes, and snippets.

@bhelx
bhelx / cedric.txt
Created February 5, 2014 19:35
Cedric Richmond on H.R. 3361
February 5, 2014
Dear Mr. bhelx,
Thank you for contacting me regarding H.R. 3361, the Uniting and
Strengthening America by Fulfilling Rights and Ending Eavesdropping,
Dragnet-collection, and On-line Monitoring (USA Freedom) Act. I
appreciate hearing from you on this issue. I am certainly concerned
@bhelx
bhelx / montyhall.py
Last active August 29, 2015 13:56
Simulation to prove answer to monty hall problem
import numpy as np
# returns a numpy array of n doors with the prize range 0-2
def simulate_prizedoors(n):
return np.random.random_integers(0, 2, size=n)
# returns a numpy array of n contestant guesses with range 0-2
def simulate_guesses(n):
return np.random.random_integers(0, 2, size=n)
@bhelx
bhelx / timed_cap.sh
Created March 13, 2014 21:15
time screen cap script ctrl+c to kill
counter=1
while true
do
sleep 1;
screencapture "$counter.jpg"
counter=$(( $counter + 1 ))
done
@bhelx
bhelx / keybase.md
Created June 13, 2014 04:24
Keybase Github Proof

Keybase proof

I hereby claim:

  • I am bhelx on github.
  • I am bhelx (https://keybase.io/bhelx) on keybase.
  • I have a public key whose fingerprint is C31E 58ED AFE3 2DE5 AC22 4461 FC6B 2D43 3F05 EFF2

To claim this, I am signing this object:

@bhelx
bhelx / counts.txt
Created August 19, 2014 22:11
calcasieu and orleans military gear
Quick counts on gear: https://github.com/TheUpshot/Military-Surplus-Gear
## ORLEANS:
RIFLE,7.62 MILLIMETER 21
TOOL KIT,GENERAL MECHANIC'S 5
FIELD PACK 5
CHARGER,BATTERY 5
OPTICAL SIGHTING AND RANGING EQUIPMENT 4
RACK,STORAGE,SMALL ARMS 4
@bhelx
bhelx / orleans_data.geojson
Created August 21, 2015 04:20
new orleans housing data since pre-katrina
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@bhelx
bhelx / nola_housing_data.csv
Created August 21, 2015 05:05
Nola housing data
zip 2015 2014 2005 pct_change_2014_2015 pct_change_2005_2015
70128 73 74.0 88.0 -1.35135135135 -17.0454545455
70129 75 89.0 68.0 -15.7303370787 10.2941176471
70126 73 72.0 71.0 1.38888888889 2.81690140845
70127 63 69.0 71.0 -8.69565217391 -11.2676056338
70122 121 115.0 92.0 5.21739130435 31.5217391304
70124 189 184.0 158.0 2.71739130435 19.6202531646
70005 204 193.0 168.0 5.69948186528 21.4285714286
70002 126 122.0 122.0 3.27868852459 3.27868852459
70006 121 121.0 120.0 0.0 0.833333333333
public class BoxParticle extends Particle {
int color;
int size;
public BoxParticle(PVector location, int color, int size) {
super(location);
this.color = color;
this.size = size;
}
@bhelx
bhelx / remembrances.rb
Created May 24, 2011 06:49
ruby learning
# Learning ruby, trying to remember these fun facts
#--ARRAYS
#--#--Useful functions
[1, 2, 3, 4].any? {|n| n > 2} #=> true
[1, 2, 3, 4].all? {|n| n > 2} #=> false
#--#--collect and map (collect! and map!)
a = [ "a", "b", "c", "d" ]
@bhelx
bhelx / deep_write.rb
Created October 8, 2011 06:33
write a file in a directory that may not exist
require 'fileutils'
def deep_write(f, data)
FileUtils.mkdir_p(File.dirname(f)) unless File.directory?(File.dirname(f))
File.open(f, 'w').write(data)
end