Skip to content

Instantly share code, notes, and snippets.

View gerryeng's full-sized avatar

Gerry Eng gerryeng

View GitHub Profile

Keybase proof

I hereby claim:

  • I am gerryeng on github.
  • I am gerryeng (https://keybase.io/gerryeng) on keybase.
  • I have a public key whose fingerprint is 7CF5 6600 1274 4369 D51F 7C5D 7413 1B9A 5A72 3D24

To claim this, I am signing this object:

/*
Implements EIP20 token standard: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md
.*/
pragma solidity ^0.4.18;
import "./EIP20Interface.sol";
@gerryeng
gerryeng / word_scan.rb
Created December 30, 2015 10:06
Find longest word using only letters in a phrase without repetition
class DScan
def self.read_file
compare = 'Coinhako Technology Bitcoin'
top_words = []
top_word_length = 0
File.open('/usr/share/dict/words').each do |word|
word = word.gsub("\n", "")
@gerryeng
gerryeng / gist:44a7dec2181a0e34ff92
Last active August 29, 2015 14:19
Adding Jade to Gruntfile

Under watch:

// Watches files for changes and runs tasks based on the changed files
watch: {
  bower: {
    files: ['bower.json'],
    tasks: ['wiredep']
  },
  coffee: {

files: ['<%= yeoman.app %>/scripts/{,/}.{coffee,litcoffee,coffee.md}'],

@gerryeng
gerryeng / api.rb
Last active August 29, 2015 14:04
Simple BlockCypher Ruby API Wrapper
require 'bitcoin'
module BlockCypher
V1 = 'v1'
BTC = 'btc'
LTC = 'ltc'
MAIN_NET = 'main'
@gerryeng
gerryeng / read.md
Created November 19, 2013 15:27
Scalable AngularJS folder structure within a Rails App

Setting up AngularJS with Rails

Gemfile

gem 'angularjs-rails'

Create /client folder in the root directory within the rails app with the following structure. And move application.js to this folder.

/client
-- app_1
@gerryeng
gerryeng / registrations_new.html.haml
Created November 15, 2013 14:47
Devise Bootstrap Haml Views
.container
.row
.col-sm-12
%h2 Register
= form_for(resource, :as => resource_name, :url => registration_path(resource_name), class: 'form-horizontal', role: 'form') do |f|
= devise_error_messages!
.form-group.row
= f.label :email, class: 'col-sm-2 control-label'
@gerryeng
gerryeng / puma.rb
Created October 29, 2013 14:48
Puma Config Sample
if Rails.env == 'production'
# Directory where App is stored on the server
apps_root_dir = "/apps"
app_name = "tv"
threads 4,4
bind "unix:///data/apps/#{app_name}/shared/tmp/puma/#{app_name}-puma.sock"
pidfile "/data/apps/#{app_name}/current/tmp/puma/pid"
state_path "/data/apps/#{app_name}/current/tmp/puma/state"
@gerryeng
gerryeng / development.rb
Created October 27, 2013 06:15
Adding additional folders to autoload in your Rails app (Rails 4)
config.autoload_paths += [
"#{Rails.root}/app/contexts",
"#{Rails.root}/app/observers",
"#{Rails.root}/app/application",
"#{Rails.root}/app/workers",
]