Skip to content

Instantly share code, notes, and snippets.

View a75c6's full-sized avatar
💭
Eating tuna

[]\ a75c6

💭
Eating tuna
View GitHub Profile
@a75c6
a75c6 / states_hash.json
Created February 26, 2017 06:31 — forked from mshafrir/states_hash.json
US states in JSON form
{
"AL": "Alabama",
"AK": "Alaska",
"AS": "American Samoa",
"AZ": "Arizona",
"AR": "Arkansas",
"CA": "California",
"CO": "Colorado",
"CT": "Connecticut",
"DE": "Delaware",
@a75c6
a75c6 / server side
Created May 10, 2016 06:38 — forked from ashwinraghav/server side
buzzfeed-digits auth snippets
func getDigitsAuthInfo(success:((info:NSDictionary)->()), failure:((error:NSError) ->())) {
let digitsAppearance = DGTAppearance()
// Change color properties to customize the look:
digitsAppearance.backgroundColor = kCuteYellowColor
digitsAppearance.accentColor = kCuteRedColor
let digits = Digits.sharedInstance()
digits.authenticateWithDigitsAppearance(digitsAppearance, viewController: nil, title: nil, completion: { (session, err) in
if (err == nil) {
let sessionDict = NSMutableDictionary(capacity: 8)
let oauthSigning = TWTROAuthSigning(authConfig: Twitter.sharedInstance().authConfig, authSession: session)
@a75c6
a75c6 / Keychain.swift
Created April 30, 2016 07:17 — forked from s-aska/Keychain.swift
Swift Keychain class ( supported Xcode 6.0.1 )
import UIKit
import Security
class Keychain {
class func save(key: String, data: NSData) -> Bool {
let query = [
kSecClass as String : kSecClassGenericPassword as String,
kSecAttrAccount as String : key,
kSecValueData as String : data ]
@a75c6
a75c6 / gist:6f274fe10d95b1be39e5a508d288264e
Created April 29, 2016 11:04 — forked from mharsch/gist:5188206
serve HLS (HTTP Live Streaming) content from node.js

HLS streaming from node

Provided that you already have a file or stream segmenter generating your .m3u8 playlist and .ts segment files (such as the ffmpeg 'hls' muxer), this little node server will serve up those files to an HLS compatible client (e.g. Safari). If you're using node for your streaming app already, this obviates the need to serve the HLS stream from a separate web server.

loosely based on https://gist.github.com/bnerd/2011232

// loosely based on https://gist.github.com/bnerd/2011232
// requires node.js >= v0.10.0
// assumes that HLS segmenter filename base is 'out'
// and that the HLS playlist and .ts files are in the current directory