Skip to content

Instantly share code, notes, and snippets.

@hugodotlau
hugodotlau / System Design.md
Created December 6, 2019 07:33 — 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?
@hugodotlau
hugodotlau / JsonHelper.java
Created December 4, 2012 07:06 — forked from codebutler/JsonHelper.java
Convert Android JSONObject/JSONArray to a standard Map/List.
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.*;
public class JsonHelper {
public static Object toJSON(Object object) throws JSONException {
if (object instanceof Map) {
JSONObject json = new JSONObject();
@hugodotlau
hugodotlau / FlashBehavior.php
Created September 27, 2012 13:42 — forked from jamband/FlashBehavior.php
Yii Framework: FlashBehavior r3
<?php
/**
* FlashBehavior class file.
*/
class FlashBehavior extends CActiveRecordBehavior
{
/**
* @var string key identifying the flash message
*/
public $key = 'success';
@hugodotlau
hugodotlau / beforeAfter.php
Created September 27, 2012 13:40
Using before and after for transactions
<?php
/**
* @property int $bit_id
*/
class Thing extends CActiveRecord {
}
/**
* @property int $id
@hugodotlau
hugodotlau / gist:3121449
Created July 16, 2012 08:01
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (PC)

Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.

Editing

Ctrl+C copy current line (if no selection)
Ctrl+X cut current line (if no selection)
Ctrl+⇧+K delete line
Ctrl+↩ insert line after