Skip to content

Instantly share code, notes, and snippets.

View ayn's full-sized avatar
🍉
wfh

Andrew Ng ayn

🍉
wfh
View GitHub Profile
@ayn
ayn / ViewController.swift
Created September 17, 2015 18:02
Twitter accounts picker, Garmin Connect devs need this shit.
//
// ViewController.swift
// TwitterAccountsDemo
//
import UIKit
import Accounts
class ViewController: UIViewController {
var twitterAccount: ACAccount? = nil {

Add CommonCrypto/module.map:

module CommonCrypto [system] {
  header "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/include/CommonCrypto/CommonCrypto.h"
  header "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/include/CommonCrypto/CommonRandom.h"
  header "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/include/CommonCrypto/CommonKeyDerivation.h"
  header "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/include/CommonCrypto/CommonCryptor.h"
  header "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/include/CommonCrypto/CommonCrypto.h"
  header "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/include/CommonCrypto/CommonRandom.h"
@ayn
ayn / -
Created October 6, 2014 21:52
brew link openssl
### Keybase proof
I hereby claim:
* I am ayn on github.
* I am ayn (https://keybase.io/ayn) on keybase.
* I have a public key whose fingerprint is 46A1 29FF 893A 0381 DC81 1E1E BED8 E882 9BFC 594C
To claim this, I am signing this object:
@ayn
ayn / gist:11199260
Created April 23, 2014 00:42
localization strings
/* Tutorial: Give it a little shake to get back to your photo roll. */
"Give it a little shake to get back to your photo roll." = "看完搖一搖,重回照片選單";
/* Tutorial: Why tap photos when you can swipe to select! */
"Why tap photos when you can swipe to select!" = "選照片還用點的?滑選才是王道!";
/* Class = "IBUIButton"; normalTitle = "Why do you need to keep your photos secret anyway?"; ObjectID = "8XM-uM-zGQ"; */
"8XM-uM-zGQ.normalTitle" = "話說,為什麼會有想要隱藏的照片呢?";
@ayn
ayn / localization.txt
Last active February 4, 2017 19:46
localization text
# App onboarding flow
en: Why tap photos when you can swipe to select!
ru: Зачем тыкать по каждой фотографии? Достаточно провести по ним палцем!
zh-TW: 簡單的滑動手指就能夠輕鬆的選擇照片!
en: Give it a little shake to get back to your photo roll.
ru: Встряхните свой телефон, что бы вернуться в фотогалерею.
zh-TW: 搖一搖iPhone可以回到你的「相片膠卷」和「儲存的照片」
@ayn
ayn / instagram tag pull.rb
Created December 9, 2013 17:03
Quick hack to pull photos from our wedding Eventstagram stream.
require "instagram"
tag = 'andrewandsherry'
Instagram.configure do |config|
config.client_id = ""
config.client_secret = ""
end
results = []
@ayn
ayn / gist:7286224
Created November 3, 2013 03:18
tweetbot for mac.hang
Date/Time: 2013-11-03 11:15:56 +0800
OS Version: 10.9 (Build 13A603)
Architecture: x86_64
Report Version: 18
Command: Tweetbot
Path: /Applications/Tweetbot.app/Contents/MacOS/Tweetbot
Version: 1.3.3 (13300)
App Item ID: 557168941
App External ID: 16735724
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.ayn.Slogger.plist</string>
<key>ProgramArguments</key>
<array>
<string>/Users/ayn/.rvm/bin/ruby-2.0.0-p247@slogger</string>
<string>/Users/ayn/work/Slogger/slogger</string>
import logging
import zerigodns
import boto
from boto.route53.record import ResourceRecordSets
from boto.s3.website import RedirectLocation
# There is no API for these so we have to embed and lookup
# https://forums.aws.amazon.com/thread.jspa?threadID=116724
# http://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region