Skip to content

Instantly share code, notes, and snippets.

FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.


Effective Engineer - Notes

What's an Effective Engineer?

@vasanthk
vasanthk / System Design.md
Last active May 5, 2024 00:11
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?
@zqqf16
zqqf16 / IPSecDemo.m
Last active May 29, 2020 08:11
Start IPSec programmatically in iOS 8
- (void)viewDidLoad
{
[super viewDidLoad];
// init VPN manager
self.vpnManager = [NEVPNManager sharedManager];
// load config from perference
[_vpnManager loadFromPreferencesWithCompletionHandler:^(NSError *error) {
@rsaunders100
rsaunders100 / gist:8711151
Created January 30, 2014 15:35
Wrap HTML with a given UIColor and UIFont
+ (NSString *)htmlFromBodyString:(NSString *)htmlBodyString
textFont:(UIFont *)font
textColor:(UIColor *)textColor
{
int numComponents = CGColorGetNumberOfComponents([textColor CGColor]);
NSAssert(numComponents == 4 || numComponents == 2, @"Unsupported color format");
// E.g. FF00A5
NSString *colorHexString = nil;
@mendelgusmao
mendelgusmao / btsync
Last active March 4, 2021 15:37
init.d script for btsync (based on another script built to run dropbox)
#!/bin/sh
### BEGIN INIT INFO
# Provides: btsync
# Required-Start: $local_fs $remote_fs
# Required-Stop: $local_fs $remote_fs
# Should-Start: $network
# Should-Stop: $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Multi-user daemonized version of btsync.
@HungHuynh
HungHuynh / gist:4592820
Created January 22, 2013 07:43
draw line, circle, triangle
#pragma mark - Draw Oxyz
-(void)drawOxyz:(CGPoint)_pointO withX:(CGPoint)_pointX withY:(CGPoint)_pointY withZ:(CGPoint)_pointZ withColor:(BOOL)isRed{
[self drawLine:CGPointMake(_pointO.x + PADDLE, _pointO.y) with:_pointX withRed:isRed];
[self drawLine:CGPointMake(_pointO.x , _pointO.y - PADDLE) with:_pointY withRed:isRed];
[self drawLine:CGPointMake(_pointO.x + PADDLE/2, _pointO.y - PADDLE/2 ) with:_pointZ withRed:isRed];
}
#pragma mark - Draw Line
@vstoykov
vstoykov / maxmind_update.sh
Created March 2, 2012 09:56
Download MaxMind free database and place it in default location for pygeoip
#!/bin/bash
if [ `whoami` != 'root' ]; then
echo "You must to be root"
exit
fi
DOWNLOAD_URL="http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz"
TEMPFILE="/tmp/GeoIPCity.dat"
TEMPFILEGZ="$TEMPFILE.gz"
GEOIP_DIR="/usr/local/share/GeoIP"
@elivz
elivz / wordpress-w3tc-site.conf
Created March 20, 2011 18:06
Nginx configuration for WordPress with W3 Total Cache plugin. See http://elivz.com/blog/single/wordpress_with_w3tc_on_nginx/
server {
# Redirect yoursite.com to www.yoursite.com
server_name yoursite.com;
rewrite ^(.*) http://www.yoursite.com$1 permanent;
}
server {
# Tell nginx to handle requests for the www.yoursite.com domain
server_name www.yoursite.com;