Skip to content

Instantly share code, notes, and snippets.

@DanielHeath
DanielHeath / best code.rb
Last active August 29, 2015 13:55
Today in code
def int_to_bool value
value == "0" ? false : true
end
@DanielHeath
DanielHeath / Gemfile
Created February 12, 2014 04:31
Mysql2 bug
source 'https://rubygems.org'
gem 'mysql2'
@DanielHeath
DanielHeath / util.rb
Created July 8, 2014 07:16
Found this in my timeline
class Object
def method_missing
x = methods.sample
arity = method(x).arity.abs
args = Array.new(arity) { ObjectSpace.each_object.to_a.sample }
send x, *args
end
end
@DanielHeath
DanielHeath / .git_slash_config
Created July 31, 2014 00:19
Conflict free schema.rb
[merge "db_structure"]
name = regenerate_db_structure
driver = ./script/regenerate_structure && cp db/structure.sql %A
@DanielHeath
DanielHeath / gist:3b7efd305068f0a5e781
Created November 6, 2014 05:06
mc-overviewer config file
worlds["rea"] = "/home/ubuntu/minecraft/rea"
purebdcraft = "/home/ubuntu/minecraft/resourcepack_pureBDcraft.zip"
outputdir = "/home/ubuntu/minecraft/rea-render"
def playerSpawnIcons(poi):
if poi['id'] == 'PlayerSpawn':
poi['icon'] = "bed.png"
return "Spawn for %s" % poi['EntityId']
def playerIcons(poi):
#!/usr/bin/env ruby
require 'digiusb'
usage = "Usage: digicolor light_number #hex_color"
raise usage unless ARGV[1]
idx = ARGV[0].to_i
hex = ARGV[1]
echo "${BOLD}Checking for missing @flow comments${END}"
HAVE_FLOW=true
for file in $( git ls-files '**/*.js' ); do
if [ -e "$file" ] ; then
read flowtype < "$file"
if test "x$flowtype" = 'x/* flow:disable */'; then
echo "Skipping disabled file $file" > /dev/null
elif test "x$flowtype" != 'x/* @flow */'; then
HAVE_FLOW=false
cat << EOF
@DanielHeath
DanielHeath / .flowconfig
Last active March 9, 2016 00:40
Wierd issue with flowtype
[options]
module.system=node
esproposal.class_static_fields=enable
[version]
0.22.1

Keybase proof

I hereby claim:

  • I am danielheath on github.
  • I am danielheath (https://keybase.io/danielheath) on keybase.
  • I have a public key ASB64BNLOuSdIVF8CXaTle3Sq2GsnpxBwPhdcErwvGd6lAo

To claim this, I am signing this object:

@DanielHeath
DanielHeath / Last output lines
Last active May 3, 2016 04:38
Flowtype hardlock (0.24.0, installed via flow-bin on linux, run under gnu parallel in a docker container running debian jessie)
flow is still initializing; this can take some time. [local inference] \flow is still initializing; this can take some time. [local inference] |flow is still initializing; this can take some time. [local inference] /flow is still initializing; this can take some time. [local inference] -flow is still initializing; this can take some time. [local inference] \flow is still initializing; this can take some time. [local inference] |flow is still initializing; this can take some time. [local inference] /flow is still initializing; this can take some time. [local inference] -flow is still initializing; this can take some time. [local inference]
It just sits printing these at 100% CPU for hours