Skip to content

Instantly share code, notes, and snippets.

View jamiehodge's full-sized avatar

Jamie Hodge jamiehodge

  • Zendesk
  • Copenhagen, Denmark
View GitHub Profile
@jamiehodge
jamiehodge / flow-output
Created May 26, 2016 21:32
Flow check output without haste
node_modules/fbjs/lib/UnicodeBidi.js.flow:28
28: import type { BidiDirection } from 'UnicodeBidiDirection';
^^^^^^^^^^^^^^^^^^^^^^ UnicodeBidiDirection. Required module not found
node_modules/fbjs/lib/UnicodeBidiService.js.flow:51
51: import type { BidiDirection } from 'UnicodeBidiDirection';
^^^^^^^^^^^^^^^^^^^^^^ UnicodeBidiDirection. Required module not found
node_modules/fbjs/lib/equalsSet.js.flow:16
16: import type Set from 'Set';
[ignore]
.*/node_modules/fbjs/lib/Deferred
.*/node_modules/fbjs/lib/PromiseMap
.*/node_modules/.*/test/
[include]
[libs]
[options]
@jamiehodge
jamiehodge / example.rb
Created November 11, 2015 20:19
Private readers (dependencies)
require 'base64'
class Foo
def initialize(bar:, baz: Base64.method(:encode64))
@bar = bar
@baz = baz
end
def to_qux
baz.(bar)
@jamiehodge
jamiehodge / example.rb
Created November 11, 2015 19:40
Private readers
class Foo
attr_reader :bar
def initialize(bar:, baz:)
@bar = bar
@baz = baz
end
def to_h
{ bar: bar, baz: baz }
@jamiehodge
jamiehodge / ffmpeg.rb
Last active August 29, 2015 13:57
ffmpeg formula
require 'formula'
class Ffmpeg < Formula
homepage 'http://ffmpeg.org/'
url 'http://ffmpeg.org/releases/ffmpeg-2.1.4.tar.bz2'
sha1 '99c2f7af3e6d5f4a962ae8bf627d3c53bc282fec'
head 'git://git.videolan.org/ffmpeg.git'
bottle do
sha1 "ddd8f0cce3e64047cd9c77eccc5d23af48ef7814" => :mavericks
require 'formula'
class Nginx < Formula
homepage 'http://nginx.org/'
url 'http://nginx.org/download/nginx-1.4.4.tar.gz'
sha1 '304d5991ccde398af2002c0da980ae240cea9356'
devel do
url 'http://nginx.org/download/nginx-1.5.7.tar.gz'
sha1 '4dd04c73c3081277fe9c98c4a386c8baf956f5ca'
@jamiehodge
jamiehodge / file.rb
Created November 22, 2013 12:38
simple mapper
require_relative 'links'
require_relative 'tags'
module Foil
class File
attr_accessor :id,
:category_id, :license_id, :visibility_id,
:description, :name,
:annotations, :authors, :editors, :links, :publishers, :tags
ld: warning: directory not found for option '-L/Users/jamiehodge/Documents/development/rubinius/rubinius/lib'
/Users/jamiehodge/Documents/development/rubinius/rubinius/bin/rbx extconf.rb
An exception occurred running extconf.rb:
no such file to load -- ffi2/generators (LoadError)
Backtrace:
Rubinius::CodeLoader#load_error at kernel/common/code_loader.rb:440
Rubinius::CodeLoader#resolve_require_path at kernel/common/code_loader.rb:423
@jamiehodge
jamiehodge / config.rb
Created October 23, 2013 07:52
config.rb
module Rubinius
config = {}
config[:config_file] = "/Users/jamiehodge/Documents/development/rubinius/rubinius/config.rb"
config[:build_tool_gems] = "HTTP/1.1 200 OK"
config[:build_c_ext_gems] = "\n"
config[:rubygems_gems] = "x-amz-version-id: ub8m1CNxjhm1vn24aplF4CDcG.AGOJcb\r\n"
config[:runtime_gems] = "a"
config[:ruby_version] = "2.1.0"
config[:version] = "2.1.1n295"
config[:libversion] = "2.1"
def download
content = Zoid::Content.new
content.write(resource.file.read)
res.body = content
res.body.close
serve
throw :halt
end