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
# ruby script for generating contact sheet images for video files. | |
# can be configured via an ini file which is expected to be in the current working directory. | |
# Requirements: | |
# - VLC (http://videolan.org) must be installed and available in the system PATH. | |
# - gem iniparse. | |
# | |
# vidsnaps will open the given video in VLC and save a screenshot at predetermined time intervals. | |
# By default it will save 20 images 500 seconds apart starting at the very beginning of the video. | |
# If these settings take it beyond the end of the video, a number of black screens will be generated, which can be ignored/deleted | |
# images are saved as png files using the format "##h##m##s.png". |
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
echo "Apple Developer Services Online\n"; curl -s https://developer.apple.com/support/system-status/ | grep "online-icon.*href" | grep -o '<a href[[:print:]]*</a>' | grep -o '>.*<' | sed -e 's/.$//' -e 's/^.//' |
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
- (void)atest1 | |
{ | |
NSLog(@"this is test 1"); | |
} | |
- (void)atest2 | |
{ | |
NSLog(@"this is test 2"); | |
[self atest2]; | |
} |
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
Show hidden characters
{ | |
"name" : "swift-oss", | |
"selector" : "source.swift", | |
"cmd": ["swift","build"], | |
"working_dir": "$project_path" | |
} |
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
// | |
// GlowFilter.swift | |
// based on ENHGlowFilter from http://stackoverflow.com/a/21586439/114409 | |
// | |
// Created by Matthew Hayes on 12/27/15. | |
// | |
import Foundation | |
import UIKit | |
import CoreImage |
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
/** | |
Compatible with the iOS 10 Beta 1 Swift Playgrounds app | |
The code below talks to NASA's "Astronomy Picture of the Day" API endpoint to download the latest picture. After running the code, the picture is viewable by tapping the image literal that appears in the right-hand margin as indicated by a comment. | |
note: Must replace "YOUR API KEY" on the first line of code, with a your personally-generated NASA api key. See the following link to get your API key: https://api.nasa.gov/index.html#apply-for-an-api-key | |
*/ | |
import Foundation | |
import UIKit |
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
Fatal Exception: NSInvalidArgumentException | |
0 CoreFoundation 0x187e1259c __exceptionPreprocess | |
1 libobjc.A.dylib 0x198a6c0e4 objc_exception_throw | |
2 CoreFoundation 0x187e124dc -[NSException initWithCoder:] | |
3 UIKit 0x18c5c7d50 -[UIView(Internal) _addSubview:positioned:relativeTo:] | |
4 UIKit 0x18c7ab4b0 __53-[_UINavigationParallaxTransition animateTransition:]_block_invoke | |
5 UIKit 0x18c5cece8 +[UIView(Animation) performWithoutAnimation:] | |
6 UIKit 0x18c7aad3c -[_UINavigationParallaxTransition animateTransition:] | |
7 UIKit 0x18c764704 -[UINavigationController _startCustomTransition:] | |
8 UIKit 0x18c675630 -[UINavigationController _startDeferredTransitionIfNeeded:] |
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
{ | |
"hello":"world" | |
} |
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
//Add this to a view controller | |
let button = UIButton(frame: CGRect(x: 0, y: 0, width: 75, height: 20)) | |
var bbItem : UIBarButtonItem! | |
extension SettingsViewController : UIPopoverPresentationControllerDelegate { | |
fileprivate func _setupPopoverTest() { | |
bbItem = UIBarButtonItem(customView: button) | |
button.setTitle("Popover", for: .normal) |
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
func parseResponse(data: Data?, response:URLResponse?, completion:(_ decodedResponse: Codable)->() ) { | |
//Handle the first matching response | |
if let decodedResponse = Decoder<User>.decode(data, response) { completion(decodedResponse) ; return } | |
if let decodedResponse = Decoder<Place>.decode(data, response) { completion(decodedResponse) ; return } | |
if let decodedResponse = Decoder<Thing>.decode(data, response) { completion(decodedResponse) ; return } | |
} | |
struct User: Codable, EndpointData { | |
static var endpoint : String { return "/user" } |
OlderNewer