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
// Playground - noun: a place where people can play | |
import Foundation | |
func DegreesToRadians (value:Double) -> Double { | |
return value * M_PI / 180.0 | |
} | |
func RadiansToDegrees (value:Double) -> Double { | |
return value * 180.0 / M_PI |
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
@interface NPClientAPI : AFHTTPSessionManager | |
- (instancetype)initWithBaseURL:(NSString *)baseURL; | |
/** | |
Singleton object. | |
*/ | |
+ (NPClientAPI *)sharedAPI; | |
/** |
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
// These two need to be declared outside the try/catch | |
// so that they can be closed in the finally block. | |
HttpURLConnection urlConnection = null; | |
BufferedReader reader = null; | |
// Will contain the raw JSON response as a string. | |
String forecastJsonStr = null; | |
try { | |
// Construct the URL for the OpenWeatherMap query |
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
console.log('Checking newly uploaded file'); | |
var AWS = require('aws-sdk'); | |
var s3 = new AWS.S3({apiVersion: '2006-03-01'}); | |
var eltr = new AWS.ElasticTranscoder({ | |
apiVersion: '2012-09-25', | |
region: 'us-east-1' | |
}); | |
// ID of pipeline | |
var pipelineId = 'myID'; | |
// ID of ET's web output preset |
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
console.log('Loading event'); | |
// Twilio Credentials | |
var accountSid = ''; | |
var authToken = ''; | |
var fromNumber = ''; | |
var https = require('https'); | |
var queryString = require('querystring'); |
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
@interface YourViewController : UIViewController <UITableViewDelegate, UITableViewDataSource> { | |
UIImageOrientation scrollOrientation; | |
CGPoint lastPos; | |
} | |
- (void) tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath { | |
if (tableView.isDragging) { | |
UIView *myView = cell.contentView; | |
CALayer *layer = myView.layer; | |
CATransform3D rotationAndPerspectiveTransform = CATransform3DIdentity; |
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)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath { | |
// setup initial state (e.g. before animation) | |
cell.layer.shadowColor = [[UIColor blackColor] CGColor]; | |
cell.layer.shadowOffset = CGSizeMake(10, 10); | |
cell.alpha = 0; | |
cell.layer.transform = CATransform3DMakeScale(0.5, 0.5, 0.5); | |
cell.layer.anchorPoint = CGPointMake(0, 0.5); | |
// define final state (e.g. after animation) & commit animation | |
[UIView beginAnimations:@"scaleTableViewCellAnimationID" context:NULL]; |
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
console.log('Loading event'); | |
// Twilio Credentials | |
var accountSid = ''; | |
var authToken = ''; | |
var fromNumber = ''; | |
var https = require('https'); | |
var queryString = require('querystring'); |
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
console.log('Checking newly uploaded file'); | |
var AWS = require('aws-sdk'); | |
var s3 = new AWS.S3({apiVersion: '2006-03-01'}); | |
var eltr = new AWS.ElasticTranscoder({ | |
apiVersion: '2012-09-25', | |
region: 'us-east-1' | |
}); | |
// ID of pipeline | |
var pipelineId = 'myID'; | |
// ID of ET's web output preset |
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
console.log('Loading event'); | |
var AWS = require('aws-sdk'); | |
exports.handler = function(event, context) { | |
console.log('Received event:'); | |
console.log(JSON.stringify(event, null, ' ')); | |
// Get the object from the event and show its content type | |
var bucket = event.Records[0].s3.bucket.name; | |
var key = event.Records[0].s3.object.key; | |
var output = Math.random().toString(36).substring(7) + ".webm"; |
OlderNewer