Skip to content

Instantly share code, notes, and snippets.

View youngshook's full-sized avatar
🐝
Working

YoungShook youngshook

🐝
Working
View GitHub Profile
@youngshook
youngshook / System Design.md
Created September 23, 2020 05:54 — 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?
@youngshook
youngshook / ios-interview-resources.md
Created September 22, 2020 09:12 — forked from funmia/ios-interview-resources.md
General iOS, CS questions and interview prep resources.
// check the name is between 4 and 16 characters
if !(4...16 ~= name.characters.count) {
return false
}
// check that name doesn't contain whitespace or newline characters
let range = name.rangeOfCharacterFromSet(.whitespaceAndNewlineCharacterSet())
if let range = range where range.startIndex != range.endIndex {
return false
}
@youngshook
youngshook / Netcat.md
Created November 7, 2018 06:45 — forked from Integralist/Netcat.md
Netcat

Install the netcat nc command with Homebrew (otherwise Mac OS X version is really old and the interface is different):

brew install netcat

Use netcat to listen for incoming TCP connections on port 3000:

nc -l -p 3000
#include <time.h>
// 字符串转时间
time_t t;
struct tm tm;
strptime([iso8601String cStringUsingEncoding:NSUTF8StringEncoding], "%Y-%m-%dT%H:%M:%S%z", &tm);
tm.tm_isdst = -1;
t = mktime(&tm);
[NSDate dateWithTimeIntervalSince1970:t + [[NSTimeZone localTimeZone] secondsFromGMT]];
if [ "${ACTION}" = "build" ]
then
INSTALL_DIR=${SRCROOT}/Products/${PROJECT_NAME}.framework
DEVICE_DIR=${BUILD_ROOT}/${CONFIGURATION}-iphoneos/${PROJECT_NAME}.framework
SIMULATOR_DIR=${BUILD_ROOT}/${CONFIGURATION}-iphonesimulator/${PROJECT_NAME}.framework
if [ -d "${INSTALL_DIR}" ]
then
rm -rf "${INSTALL_DIR}"
fi
mkdir -p "${INSTALL_DIR}"
@youngshook
youngshook / AppleCertDisplay.ruby
Created March 20, 2017 03:42
A Ruby Script Display Apple Cert
require 'spaceship'
Spaceship.login('AppleDevID')
Spaceship.select_team
Spaceship.certificate.all.each do |cert|
cert_type = Spaceship::Portal::Certificate::CERTIFICATE_TYPE_IDS[cert.type_display_id].to_s.split("::")[-1]
puts "Cert id: #{cert.id}, name: #{cert.name}, expires: #{cert.expires.strftime("%Y-%m-%d")}, type: #{cert_type}"
end
@youngshook
youngshook / XCDFakeCarrier.m
Created August 1, 2016 09:20 — forked from 0xced/XCDFakeCarrier.m
Hack to choose the displayed carrier name in the iOS simulator
//
// Copyright (c) 2012-2015 Cédric Luthi / @0xced. All rights reserved.
//
#import <Foundation/Foundation.h>
#if TARGET_OS_SIMULATOR
static const char *fakeCarrier;
static const char *fakeTime;
@youngshook
youngshook / Surge.conf
Created May 20, 2016 09:28
Config for surge.app
#Surge Mac: Start from 1.3.0
#Surge iOS: Start from TF 542
[General]
skip-proxy = 192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12, 127.0.0.0/8, 100.64.0.0/10, localhost, *.local, ::ffff:0:0:0:0/1, ::ffff:128:0:0:0/1, e.crashlytics.com
bypass-tun = 192.168.0.0/16, 0.0.0.0/8, 1.0.0.0/9, 1.160.0.0/11, 1.192.0.0/11, 10.0.0.0/8, 14.0.0.0/11, 14.96.0.0/11, 14.128.0.0/11, 14.192.0.0/11, 27.0.0.0/10, 27.96.0.0/11, 27.128.0.0/9, 36.0.0.0/10, 36.96.0.0/11, 36.128.0.0/9, 39.0.0.0/11, 39.64.0.0/10, 39.128.0.0/10, 42.0.0.0/8, 43.224.0.0/11, 45.64.0.0/10, 47.64.0.0/10, 49.0.0.0/9, 49.128.0.0/11, 49.192.0.0/10, 54.192.0.0/11, 58.0.0.0/9, 58.128.0.0/11, 58.192.0.0/10, 59.32.0.0/11, 59.64.0.0/10, 59.128.0.0/9, 60.0.0.0/10, 60.160.0.0/11, 60.192.0.0/10, 61.0.0.0/10, 61.64.0.0/11, 61.128.0.0/10, 61.224.0.0/11, 100.64.0.0/10, 101.0.0.0/9, 101.128.0.0/11, 101.192.0.0/10, 103.0.0.0/10, 103.192.0.0/10, 106.0.0.0/9, 106.224.0.0/11, 110.0.0.0/7, 112.0.0.0/9, 112.128.0.0/11, 112.192.0.0/10, 113.0.0.0/9, 113.128.0.0/11, 113.192.0.0/10, 114.