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
require 'oat/adapters/hal'
class BooticAdapter < Oat::Adapters::HAL
def type(*types)
property :_class, *types
end
def curie(link_opts)
data[:_links][:curies] ||= []
data[:_links][:curies] << link_opts
end
@cheeyeo
cheeyeo / benchmark.rb
Created August 30, 2016 15:51
Benchmark to_proc vs block in Enumerable#map
#/usr/bin/env ruby
require "benchmark/ips"
arr = [1.0, 2.0, 3.0]
h = { foo: 1, bar: 2, baz: 3 }
class Double
def to_proc
@cheeyeo
cheeyeo / sayings.md
Created July 27, 2016 16:43
WISE SAYINGS
  1. Your job won’t take care of you when you are sick. Your friends and family will.

  2. If a relationship has to be a secret, you shouldn’t be in it.

  3. Burn the candles, use the nice sheets, wear the fancy lingerie. Don’t save it for a special occasion. Today is special.

  4. Frame every so-called disaster with these words, ‘In five years, will this matter?’

  5. Don’t take yourself so seriously. No one else does.

@cheeyeo
cheeyeo / expng.ex
Created June 3, 2016 23:42 — forked from zabirauf/expng.ex
PNG format Parser in Elixir
defmodule Expng do
defstruct [:width, :height, :bit_depth, :color_type, :compression, :filter, :interlace, :chunks]
def png_parse(<<
0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A,
_length :: size(32),
"IHDR",
width :: size(32),
height :: size(32),
package sri
import (
"crypto/sha256"
"encoding/base64"
"fmt"
"io/ioutil"
)
func Generate256(file string) (string, error) {
@cheeyeo
cheeyeo / FTDI_Basic_Hookup_for_ESP-01.jpg
Created April 16, 2016 13:49 — forked from stonehippo/FTDI_Basic_Hookup_for_ESP-01.jpg
Notes on using the ESP8266 with the Arduino IDE
FTDI_Basic_Hookup_for_ESP-01.jpg
@cheeyeo
cheeyeo / notes.md
Created March 30, 2016 16:29
Using git cherry-pick and rebase

If only cherry picking the odd commit can do so directly using following:

git checkout master

git cherry-pick 62ecb3

The new commit 62ecb3 is applied to the master branch as a new commit through merge. Any conflicts has to be resolved.

For a range of commits, rebase is a better option.