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 | |
# | |
# convert-video.sh | |
# | |
# Copyright (c) 2013-2014 Don Melton | |
# | |
about() { | |
cat <<EOF | |
$program 2.0 of December 3, 2014 |
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
extension Array { | |
func first() -> Element? { | |
if isEmpty { | |
return nil | |
} | |
return self[0] | |
} | |
func last() -> Element? { |
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
opena(){ | |
if test -n "$(find . -maxdepth 1 -name '*.xcworkspace' -print -quit)" | |
then | |
echo "Opening workspace" | |
open *.xcworkspace -a /Applications/AppCode.app | |
return | |
else | |
if test -n "$(find . -maxdepth 1 -name '*.xcodeproj' -print -quit)" | |
then | |
echo "Opening project" |
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
#ifndef NS_DESIGNATED_INITIALIZER | |
#if __has_attribute(objc_designated_initializer) | |
#define NS_DESIGNATED_INITIALIZER __attribute((objc_designated_initializer)) | |
#else | |
#define NS_DESIGNATED_INITIALIZER | |
#endif | |
#endif |
This template let's you easily implement a property getter like this:
- (UIView *)myView {
if (!_myView) {
_myView = [UIView new];
}
return _myView;
}
Since I always declare private properties in the class implementation file it's nice to have new class implementation files already include a class extension.
This is my template file for doing this. You change the template in Preferences->File and Code Templates->Templates->Objective-C Class.
#parse("Objective-C File Header.m")
#import "${HEADER_FILENAME}"
@interface ${NAME} ()
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
var AWS = require('aws-sdk'), | |
fs = require('fs'); | |
// For dev purposes only | |
AWS.config.update({ accessKeyId: '...', secretAccessKey: '...' }); | |
// Read in the file, convert it to base64, store to S3 | |
fs.readFile('del.txt', function (err, data) { | |
if (err) { throw err; } |
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 | |
# | |
# convert-video.sh | |
# | |
# Copyright (c) 2013-2014 Don Melton | |
# | |
about() { | |
cat <<EOF | |
$program 2.0 of December 3, 2014 |
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 | |
# | |
# detect-crop.sh | |
# | |
# Copyright (c) 2013-2015 Don Melton | |
# | |
about() { | |
cat <<EOF | |
$program 3.3 of January 22, 2015 |