Skip to content

Instantly share code, notes, and snippets.


Mike Myat Min Han mmhan

View GitHub Profile
mmhan / reform_simple_form.rb
Created Aug 21, 2020
Reform and Form Helper workaround
View reform_simple_form.rb
# concepts/thing/contract/contract.rb
require 'disposable/twin/property/hash'
module Thing::Contract
class Contract < Reform::Form
include Disposable::Twin::Property::Hash
property :data, field: :hash do
property :foo_bar
mmhan / merge_vs_assign.rb
Last active Apr 5, 2017
Ruby's hash `merge!` vs `[]`
View merge_vs_assign.rb
require "benchmark"
n = 100_000 do |x|"merge! : ") do
a = {}
n.times { |i| a.merge! i => "1" }
// simple constructor
private final int x;
private final int y;
private final String z;
public MyClass(int x, int y, String z) {
this.x = x;
this.y = y;
this.z = z;
View person.rb
class Person
@@klass_name = "Person"
def initialize(name)
@name = name
def self.klass_name


  • WPM > 40
  • Typo-less, par grammar
  • Soft Tab, 2 spaces.
    • Sublime -
    • Vim -
    • Android Studio 0-
    • XCode -
mmhan / original
Last active Jan 4, 2016
The Tortoise and the Hare
View original
There is a Hare and
a tortoise.
The hare and tortoise race.
The hare thinks that he is fast
and the tortoise is slow.
He decided to take a nap.
But he slept for too long and the tortoise passes him.
And the tortoise won the race.
mmhan / gist:8131701
Created Dec 26, 2013
MM Phone Number Regex
View gist:8131701
/^((\+\d+)*(\d+)[- ])*\d{3,}[- ]*\d{3,}$/
View gist:8028360
root (hd0, 5)
kernel /vmlinuz root=/dev/sda6
initrd /initrd.img
mmhan / api.php
Last active Dec 25, 2015
Parameters and terms
View api.php
* Will take given parameters, query and return a list of listings for given params
* ===================
* q Search string. Default = null (optional)
* build Car's build type Default = null (optional)
* make Manufacturer Default = null (optional)
View functions.php
* MMJDB Google docs form embedding
function mmjdb_some_form(){
echo '<iframe src="" width="906" height="790" frameborder="0" marginheight="0" marginwidth="0">Loading...</iframe>';
You can’t perform that action at this time.