Skip to content

Instantly share code, notes, and snippets.

View MutatedBread's full-sized avatar

Ng Chen Hon (Mutatedbread) MutatedBread

View GitHub Profile
@MutatedBread
MutatedBread / COVER_LETTER_EXAMPLE.md
Last active January 2, 2017 07:56
Application/Cover Letter Example

###Xiao Ming
Kuala Lumpur, Malaysia | +60123456789 | xiaoming@example.com


January 2, 2017

Supermegaultracoder Inc Human Resource Manager

999 Jalan Pisang,

@MutatedBread
MutatedBread / foobar_3.py
Last active April 3, 2017 07:49
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]
#include <iostream>
#include <iomanip>
#include <Box2D/Box2D.h>
using namespace std;
int main()
{
//Construct a b2World
b2Vec2 gravity(0.0f, -10.0f);

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/index.android.bundle --platform android --dev false

@MutatedBread
MutatedBread / some-gsutil-useful.md
Last active April 7, 2019 09:21
Some useful gsutil commands

Some useful gsutil Commands

Make bucket

gsutil mb gs://new_bucket/

Upload

@MutatedBread
MutatedBread / use-pointer-or-value.md
Last active May 20, 2019 13:35
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
MutatedBread / rails-routes-practice.md
Created May 23, 2019 04:24
Writing down rails resource route in namespace practice.
namespace :admin do
  resources :articles, :comments
end
  1. index
  • admin_articles_path
  • admin_articles_url