Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View sunnycmf's full-sized avatar
🎯
Focusing

Sunny Chan sunnycmf

🎯
Focusing
  • Carousell
  • Hong Kong
View GitHub Profile
@sunnycmf
sunnycmf / System Design.md
Created September 25, 2019 05:42 — forked from vasanthk/System Design.md
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@sunnycmf
sunnycmf / README.md
Created April 18, 2018 07:53 — forked from joyrexus/README.md
form-data vs -urlencoded

Nice answer on stackoverflow to the question of when to use one or the other content-types for POSTing data, viz. application/x-www-form-urlencoded and multipart/form-data.

“The moral of the story is, if you have binary (non-alphanumeric) data (or a significantly sized payload) to transmit, use multipart/form-data. Otherwise, use application/x-www-form-urlencoded.”


Matt Bridges' answer in full:

The MIME types you mention are the two Content-Type headers for HTTP POST requests that user-agents (browsers) must support. The purpose of both of those types of requests is to send a list of name/value pairs to the server. Depending on the type and amount of data being transmitted, one of the methods will be more efficient than the other. To understand why, you have to look at what each is doing

@sunnycmf
sunnycmf / ioslocaleidentifiers.csv
Created August 2, 2017 08:23 — forked from jacobbubu/ioslocaleidentifiers.csv
iOS Locale Identifiers
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
mr Marathi
bs Bosnian
ee_TG Ewe (Togo)
ms Malay
kam_KE Kamba (Kenya)
mt Maltese
ha Hausa
es_HN Spanish (Honduras)
ml_IN Malayalam (India)
ro_MD Romanian (Moldova)
@sunnycmf
sunnycmf / postgres-cheatsheet.md
Created March 13, 2017 10:57 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

If run with -E flag, it will describe the underlaying queries of the \ commands (cool for learning!).

Most \d commands support additional param of __schema__.name__ and accept wildcards like *.*

@sunnycmf
sunnycmf / The Technical Interview Cheat Sheet.md
Created February 8, 2017 08:00 — forked from tsiege/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.
@sunnycmf
sunnycmf / osx_setup.md
Created November 22, 2016 05:36 — forked from millermedeiros/osx_setup.md
Mac OS X setup.

Setup Mac OS X Mountain Lion or Mavericks

Edit: I few months ago I got a new laptop and did the same thing on Mavericks.

I just replaced the hard drive of my mbp and decided to do a clean install of Mountain Lion (10.8.5) since I was still using Snow Leopard (10.6.8).

I kinda regret for not using Boxen to automate the

@sunnycmf
sunnycmf / deployment-tool-ansible-puppet-chef-salt.md
Created November 11, 2016 07:40 — forked from jaceklaskowski/deployment-tool-ansible-puppet-chef-salt.md
Choosing a deployment tool - ansible vs puppet vs chef vs salt

Requirements

  • no upfront installation/agents on remote/slave machines - ssh should be enough
  • application components should use third-party software, e.g. HDFS, Spark's cluster, deployed separately
  • configuration templating
  • environment requires/asserts, i.e. we need a JVM in a given version before doing deployment
  • deployment process run from Jenkins

Solution

@sunnycmf
sunnycmf / android_instructions.md
Created August 11, 2016 06:39 — forked from patrickhammond/android_instructions.md
Easily setup an Android development environment on a Mac

Here is a high level overview for what you need to do to get most of an Android environment setup and maintained.

Prerequisites (for Homebrew at a minimum, lots of other tools need these too):

  • XCode is installed (via the App Store)
  • XCode command line tools are installed (xcode-select --install will prompt up a dialog)
  • Java

Install Homebrew:

ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"

@sunnycmf
sunnycmf / wechat.io.conf
Created May 9, 2016 17:14 — forked from likidu/wechat.io.conf
Nginx Settings for NodeJS App
# Nginx Reverse Proxy for NodeJS Apps
server
{
listen 80;
server_name wechat.io;
index index.html index.htm index.php default.html default.htm default.php;
root /home/wwwroot/wechat.io;
include none.conf;
if ($http_host != "wechat.io") {
@sunnycmf
sunnycmf / mitmproxy pf
Created May 9, 2016 16:41 — forked from khapota/mitmproxy pf
/etc/pf.anchors/mitm
rdr pass on en0 inet proto tcp to any port 80 -> 127.0.0.1 port 8080
rdr pass on en0 inet proto tcp to any port 443 -> 127.0.0.1 port 8080