Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@mmhan
mmhan / how-i-work-template.md
Created July 22, 2022 02:21 — forked from jazzsequence/how-i-work-template.md
Template for How I Like to Work posts

How I work

This is my own interpretation of how I like to work, feedback welcome! Especially if my own view of how I think I like to work doesn't match your experience of how it seems I like to work!

When I work

@mmhan
mmhan / reform_simple_form.rb
Created August 21, 2020 06:22
Reform and Form Helper workaround
# 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
mmhan / merge_vs_assign.rb
Last active April 5, 2017 13:24
Ruby's hash `merge!` vs `[]`
require "benchmark"
n = 100_000
Benchmark.bm(7) do |x|
x.report("merge! : ") do
a = {}
n.times { |i| a.merge! i => "1" }
end
// 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;
class Person
@@klass_name = "Person"
def initialize(name)
@name = name
end
def self.klass_name
@@klass_name
end

General

  • WPM > 40
    • typing.io
  • Typo-less, par grammar
  • Soft Tab, 2 spaces.
    • Sublime -
    • Vim -
    • Android Studio 0-
  • XCode -
@mmhan
mmhan / feeds.sh
Last active August 29, 2015 13:57
curl --header 'Content-Type: application/json' \
--header 'Snit-Session: <skey>' \
http://localhost:3000/feed/<epoch>
curl --header 'Content-Type: application/json' \
--header 'Snit-Session: <skey>' \
http://localhost:3000/feed/0
curl --header 'Content-Type: application/json' \
--header 'Snit-Session: SNIT_SESSION_KEY' \
http://<api_url>/feed/mine
@mmhan
mmhan / test.sh
Last active August 29, 2015 13:57
curl -X POST \
--header 'Content-Type: application/json' \
-d '{"ph":"0912345678","nick":"","name":"Thar Htet","email":"bla@gmail.com","pwd":"12345678"}' \
http://localhost:3000/sign_up