Skip to content

Instantly share code, notes, and snippets.

Avatar

Jamie Hodge jamiehodge

  • Zendesk
  • Copenhagen, Denmark
View GitHub Profile
@jamiehodge
jamiehodge / flow-output
Created May 26, 2016
Flow check output without haste
View flow-output
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';
View .flowconfig
[ignore]
.*/node_modules/fbjs/lib/Deferred
.*/node_modules/fbjs/lib/PromiseMap
.*/node_modules/.*/test/
[include]
[libs]
[options]
@jamiehodge
jamiehodge / example.rb
Created Nov 11, 2015
Private readers (dependencies)
View example.rb
require 'base64'
class Foo
def initialize(bar:, baz: Base64.method(:encode64))
@bar = bar
@baz = baz
end
def to_qux
baz.(bar)
View example.rb
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 Aug 29, 2015
ffmpeg formula
View ffmpeg.rb
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
View nginx.rb
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'
View file.rb
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
View gist:7344712
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
View 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"
View download.rb
def download
content = Zoid::Content.new
content.write(resource.file.read)
res.body = content
res.body.close
serve
throw :halt
end