Skip to content

Instantly share code, notes, and snippets.


Ng Chen Hon (Mutatedbread) MutatedBread

View GitHub Profile
MutatedBread /
Created May 23, 2019
Writing down rails resource route in namespace practice.
namespace :admin do
  resources :articles, :comments
  1. index
  • admin_articles_path
  • admin_articles_url
MutatedBread /
Last active May 20, 2019
A note on using pointer or value receiver in a golang function.
func (s *MyStruct) pointerMethod() { } // method on pointer
func (s MyStruct)  valueMethod()   { } // method on value
  1. Receiver behaves like an argument given to a function.
  2. Perserve consistency for a struct, if use pointer, use pointer for all, vise versa.

Use Pointer

  1. Function needs to modify the receiver
MutatedBread /
Last active Apr 7, 2019
Some useful gsutil commands

Some useful gsutil Commands

Make bucket

gsutil mb gs://new_bucket/



Bundle Assets and Script

react-native bundle --assets-dest ./android/app/src/main/res/ --entry-file ./index.js --bundle-output ./android/app/src/main/assets/ --platform android --dev false

View helloworld-box2d.cpp
#include <iostream>
#include <iomanip>
#include <Box2D/Box2D.h>
using namespace std;
int main()
//Construct a b2World
b2Vec2 gravity(0.0f, -10.0f);
MutatedBread /
Last active Apr 3, 2017
Foobar challenge : gear_on_destruction. My answer spent 3 days of weekend thinking. It can get 7 test cases out of 10 correct only. Use for reference only. I am too lazy to comment on the code for the moment.
from decimal import *
from fractions import Fraction
def answer(pegs):
# your code here
distance = []
radiusSampleSet = []
radius = [-1, -1]
MutatedBread /
Last active Jan 2, 2017
Application/Cover Letter Example

###Xiao Ming
Kuala Lumpur, Malaysia | +60123456789 |

January 2, 2017

Supermegaultracoder Inc Human Resource Manager

999 Jalan Pisang,