Skip to content

Instantly share code, notes, and snippets.

View cheeyeo's full-sized avatar
💭
Researching on use of transformers in computer vision

Chee Yeo cheeyeo

💭
Researching on use of transformers in computer vision
View GitHub Profile
# Natively, Enumerators get JSONized like "#<Enumerator::Lazy:0x007f8714807080>", or they explode, either of which is a problem.
# We want them to make an array, and do it lazily so we don't have to keep the items in memory!
class Enumerator
def to_json(state)
state.depth += 1
string = "[\n"
first_item = true
self.each do |item|
@cheeyeo
cheeyeo / Gemfile
Last active August 29, 2015 14:13 — forked from mattbrictson/Gemfile
gem 'dragonfly', '~>0.9.4'
group :production do
gem 'fog' # for Amazon S3
end
@cheeyeo
cheeyeo / keybase.md
Last active August 29, 2015 14:12 — forked from ismasan/keybase.md

Keybase proof

I hereby claim:

  • I am ismasan on github.
  • I am ismasan (https://keybase.io/ismasan) on keybase.
  • I have a public key whose fingerprint is 3E67 5E59 B46D D332 2669 6883 2AA1 2B6D 5825 B214

To claim this, I am signing this object:

@cheeyeo
cheeyeo / Procfile
Last active August 29, 2015 14:12 — forked from jbhannah/Procfile
web: bundle exec puma -p $PORT config.ru
@cheeyeo
cheeyeo / proxy.rb
Last active August 29, 2015 14:10 — forked from torsten/proxy.rb
#!/usr/bin/env ruby
# A quick and dirty implementation of an HTTP proxy server in Ruby
# because I did not want to install anything.
#
# Copyright (C) 2009-2014 Torsten Becker <[email protected]>
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
#!/usr/bin/env ruby
cmd = %q[echo '3...'; sleep 1;
echo '2...'; sleep 1;
echo '1...'; sleep 1;
echo 'Liftoff!']
puts '------ beginning command ------'
output_log = []
IO.popen(cmd).each do |line|
# blog post: http://blog.slashpoundbang.com/post/1455548868/memcachemodel-make-any-ruby-object-that-persists-in
# No transactions or exceptions (yet).
module MemcacheModel
def self.included(base)
base.class_eval do
extend ActiveModel::Naming
extend ActiveModel::Translation
extend ActiveModel::Callbacks
extend MemcacheModel::ClassMethods
#!/bin/sh
usage ()
{
cat <<EOF
docker-enter -- Enter a running container via boot2docker and nsenter
Usage: docker-enter <container_name_or_ID> [command]
See https://github.com/jpetazzo/nsenter for details.
require 'rubygems'
require 'gsl'
users = { 1 => "Ben", 2 => "Tom", 3 => "John", 4 => "Fred" }
m = GSL::Matrix[
#Ben, Tom, John, Fred
[5,5,0,5], # season 1
[5,0,3,4], # season 2
[3,4,0,3], # season 3
[0,0,5,3], # season 4
z = fn
f -> fn
x -> f.(fn y -> x.(x).(y) end)
end.(fn
x -> f.(fn y -> x.(x).(y) end)
end)
end
add_squares = z.(fn
f -> fn