Spotify | Apple Music |
---|---|
Amazon Echo integration | Offline Apple Watch playback |
Smart playlists |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# A simple script to generate an animated gif from an mp4 file. | |
# | |
# Some notes: | |
# - To use this you need both ffmpeg and imagemagick installed. You can 'brew install' both of them. | |
# - Our version of github enterprise has a 10MB size limit per file. Make sure your gifs are below that limit. | |
# | |
# This is based on https://gist.github.com/dergachev/4627207 | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
import Result | |
import Security | |
/** | |
* A simple wrapper around the Security framework’s keychain functions, providing a Swifty-er API. | |
*/ | |
typealias KeychainQuery = [String: Any] | |
struct Keychain { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protocol TextContaining { | |
var isEmpty: Bool { get } | |
} | |
extension String: TextContaining { | |
} | |
extension Optional where Wrapped: TextContaining { | |
var isEmpty: Bool { | |
switch self { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright (c) 2012 Tumblr. All rights reserved. | |
// License: Apache 2.0 | |
// We're using an 'active' class instead of the default :active pseudo selector because we can add/remove it easily | |
var elementsWithActiveStateSelector = ['.tumblelog', '.control', '.audio-player', '.tag', 'a', '.video', | |
'.gif-container', '.external-image-placeholder'].join(','); | |
$('#content').on('touchstart', elementsWithActiveStateSelector, function() { | |
var $el = $(this); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protocol Foo { | |
} | |
extension Foo { | |
func bar() -> Self { return self } | |
} | |
extension NSObject: Foo {} | |
let view = UIView().bar() // Value of type `UIView` has no member `bar` |
-
When volume switch is On, phone both makes noise and vibrates.
-
When volume switch is Off, phone does not make noise or vibrate.
-
Calls should make noise/vibrate in extenuating cirumstances, e.g. a call from a favorite or two calls within three minutes.
Vibrate on Silent accomplishes 1 and 2, but prevents 3 from occurring.
3 could be accomplished by ignoring the volume switch altogether and using Do Not Disturb to solely determine whether my phone is silent or not. In this case, I would have DND turned on almost all of the time. The problem with this is that when the phone is unlocked/in use, notifications will either A) not be shown at all or B) will cause noise/vibration.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import sys | |
if __name__ == '__main__': | |
filename = sys.argv[1]; | |
input = open(filename) | |
output = open(filename + '.out', 'w') | |
for line in input: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct ViewControllerSequence { | |
typealias ViewControllerProducer = Void -> UIViewController | |
private var storage = TypeDictionary<ViewControllerProducer>() | |
private var producers: [ViewControllerProducer] | |
init(_ producers: [ViewControllerProducer]) { | |
self.producers = producers | |
} |