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
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 / streaming_ruby_http_response.rb
Created March 23, 2016 20:41 — forked from ismasan/streaming_ruby_http_response.rb
Streaming HTTP response body in Ruby, exposing an IO-like response object.
require 'uri'
require 'net/protocol'
require 'byebug'
class Request
VERBS = {
get: 'GET'
}
@cheeyeo
cheeyeo / gist:6502807b18f98a4499d9
Created March 23, 2016 20:37 — forked from cfjedimaster/gist:2313466
Conditional jQuery resource get
<!DOCTYPE html>
<html>
<head>
<title>Conditional Get</title>
<script src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
<script>
$(document).ready(function() {
var theResource = "dump.zip";
# we'll use 2 processors/core
worker_processes 2;
# we set a new limit for open files for our workers
worker_rlimit_nofile 100000;
# we define how we're going to work
events {
# for each worker we'll handle 4000 requests (enquee them)
worker_connections 4000;
# we'll accept multiple
#!/usr/bin/env bash
curl https://s3.amazonaws.com/heroku-jvm-buildpack-vi/vim-7.3.tar.gz --output vim.tar.gz
mkdir vim && tar xzvf vim.tar.gz -C vim
export PATH=$PATH:/app/vim/bin
@cheeyeo
cheeyeo / config.ru
Created January 27, 2016 21:43 — forked from ismasan/config.ru
Custom top level rack middleware
# This file is used by Rack-based servers to start the application.
require ::File.expand_path('../config/environment', __FILE__)
class MyMiddleware
def initialize(app)
@app = app
end
def call(env)
@cheeyeo
cheeyeo / gist:64e406c0e7960b23c119
Created January 27, 2016 21:31 — forked from saetia/gist:1623487
Clean Install – OS X 10.11 El Capitan

OS X Preferences


most of these require logout/restart to take effect

# Enable character repeat on keydown
defaults write -g ApplePressAndHoldEnabled -bool false

# Set a shorter Delay until key repeat
# Other syntax without patch
STUDENT_LEVELS = {
freshman: Student::Underclassman,
sophomore: Student::Underclassman,
junior: Student::Upperclassman,
senior: Student::Upperclassman,
graduate: Student::Graduate
}.tap { |h| h.default = Student::Unregistered }
@cheeyeo
cheeyeo / how_many_nodes.rb
Created January 2, 2016 19:11 — forked from radarek/how_many_nodes.rb
Veryfing "Table 1—Number of additional T_NODE objects created by an iterator" from "Ruby Performance Optimization" book
def count_nodes(label)
before = ObjectSpace.count_objects
yield
after = ObjectSpace.count_objects
puts " #{label} created T_NODE: %d" % (after[:T_NODE] - before[:T_NODE])
end
class MyClass
include Enumerable