Skip to content

Instantly share code, notes, and snippets.

leave in Feb 2020

Jerry Cheung jch

leave in Feb 2020
Block or report user

Report or block jch

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View mint.rb
# Clean up Mint exported transactions for working with a spreadsheet
# Usage:
# ruby mint.rb <transactions.csv>
# Export a CSV of transactions from Mint
# Tags are not exported, so it must be filtered out before export:
View vagrant-success.txt
Last login: Tue Aug 23 13:16:58 on ttys003
jch@Jerrys-MacBook-Pro:~$ cd projects/ruby-net-ldap/
jch@Jerrys-MacBook-Pro:~/projects/ruby-net-ldap[tls-verify-hostnames]$ cd test/support/vm/openldap
jch@Jerrys-MacBook-Pro:~/projects/ruby-net-ldap/test/support/vm/openldap[tls-verify-hostnames]$ vagrant destroy
==> default: VM not created. Moving on...
jch@Jerrys-MacBook-Pro:~/projects/ruby-net-ldap/test/support/vm/openldap[tls-verify-hostnames]$ gem uninstall vagrant
jch@Jerrys-MacBook-Pro:~/projects/ruby-net-ldap/test/support/vm/openldap[tls-verify-hostnames]$ rbenv rehash
jch@Jerrys-MacBook-Pro:~/projects/ruby-net-ldap/test/support/vm/openldap[tls-verify-hostnames]$ hash -r
jch@Jerrys-MacBook-Pro:~/projects/ruby-net-ldap/test/support/vm/openldap[tls-verify-hostnames]$ vagrant plugin install vagrant-vbguest
Installing the 'vagrant-vbguest' plugin. This can take a few minutes...
View vagrant-error-ruby-net-ldap.txt
$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'hashicorp/precise64'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'hashicorp/precise64' is up to date...
==> default: Setting the name of the VM: openldap_default_1471972387230_9628
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
default: Adapter 2: hostonly
View rack-tracer.rb
require 'rack'
# Track changes in rack requests and responses made by middleware.
# SomeMiddleware
# request: ...
# response: ...
# AnotherMiddleware
# request: ...
# response: ...
View net-ldap-map-message-id.rb
# Proposal for mapping responses back to requests for Net::LDAP.
require "fiber"
module Net
module LDAP
class Connection
# Hash of Responses keyed by message_id
attr_reader :responses
# Fake socket to read/write from
  • Kabana Restaurant - 1106 University Ave. Berkeley, CA 94702
  • Taste of the Himalayas - 1700 Shattuck Ave.Ste. A Berkeley, CA 94709
  • Brazil Cafe - 1960 University Ave Berkeley, CA 94704
  • Arabica Restaurant Mediterranean Cuisine - 2115 Kittredge St Berkeley, CA 94704
  • Claremont Diner - 6200 Claremont Ave. Oakland, CA 94618
  • Miss Saigon Vietnamese Restaurant - 3345 Grand Ave. Oakland, CA 94610
  • Siam Orchid Thai Restaurant - 23-H Orinda Way Orinda, CA 94563
  • Holy Land Restaurant - 677 Rand Ave. Oakland, CA 94610
  • Lazeeza Pakistani & Indian Cruise - 10 Hegenberger Rd Oakland, CA 94621
  • Saroor Indian Cuisine - 2580 N. Main St. Walnut Creek, CA 94596
jch /
Last active Aug 29, 2015
How to clean up your Mac Messages contact list
  • Delete Google Plus profile - stops the syncing of circles and friends
  • Revert to old Google Talk
  • Unlink Google account from System Preferences -> Internet Accounts
  • Clean up contacts in
  • Open messages, select all, remove
  • Remove Messages related plists
  • Re-add Google account to Internet Accounts
  • Open Apple Contacts - this should now pull down a clean list of your contacts
  • Open Messages
  • Open GMail, from the chat, message the contacts you want to show up in Messages. This will send an invite to Messages that you can accept

Keybase proof

I hereby claim:

  • I am jch on github.
  • I am jch ( on keybase.
  • I have a public key whose fingerprint is FAE8 17C4 6934 9DB4 8B49 FE0B 7374 4527 759B EE9C

To claim this, I am signing this object:


This is a quick brain dump of problems I've run into using Rails Engines.


  • Dependencies If an Engine requires a gem at version X, and the application requires the same gem at version Y. You could specify a lose version constraint on the Engine, but that's just asking for trouble. If the application updates to a newer version that the Engine isn't expecting, things go wrong.
  • Layouts/Assets To customize these, you need to overwrite certain magical paths. This ends up duplicating a lot of the engine and forces you to dig into the internals of how the Engine works rather than trusting it as a standalone component.
  • Models If you use an Engine's models, you're crossing into the Engine's abstractions again. It seems like a good place to share code, but it means your models will need to become versioned.
  • Complexity It's hard to debug problems when they come up. Is it coming from the engine, the app, or the app's overrides of the engine

JavaScript Toolbox

This is a list of JavaScript libraries I like or would like to investigate. It will be kept short intentionally to be things I find useful for most JS projects.


  • Karma - test runner. adapters for testing libraries, runs within browser clients
  • Mocha - test library
  • Sinon.js - spies and stubs. Can create fake servers and responses.
  • QUnit - test library. like it's simplicity. Also likely to be maintained long-term because of jQuery. Will take off the list if I like Mocha.
You can’t perform that action at this time.