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
- name: print to stdout | |
command: echo "hello" | |
register: hello | |
- debug: msg="{{ hello.stdout }}" | |
- debug: msg="{{ hello.stderr }}" |
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
@Test | |
public void testValidateInitialDetailsCapture() { | |
MyModel myModel = new MyModel(); | |
// setup: | |
MyModel.setSomeField("Some Value"); | |
// this is the line that stumped me | |
ValidationContext validationContext = new DefaultValidationContext(requestContext, null, 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
@Test | |
public void testValidateSomeEventId() { | |
// setup: | |
// mock request | |
MockRequestContext requestContext = new MockRequestContext(); | |
// mock message context: | |
MessageContext messages = requestContext.getMessageContext(); | |
messages.clearMessages(); |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Hello</title> | |
</head> | |
<body ng-app="HelloWorldApp" > | |
<div ng-controller="HelloController" class="container" > | |
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
let url = NSURL(string: "http://www.haskell.org/happy/Happy.gif") | |
let urlRequest = NSURLRequest(URL: url) | |
NSURLConnection.sendAsynchronousRequest(urlRequest, queue: NSOperationQueue.mainQueue(), | |
completionHandler: { | |
response, data, error in | |
if error != nil { | |
println("There was an error") | |
} else { |
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
let url = NSURL(string: "http://www.haskell.org/happy/Happy.gif") | |
let urlRequest = NSURLRequest(URL: url) | |
NSURLConnection.sendAsynchronousRequest(urlRequest, queue: NSOperationQueue.mainQueue(), | |
completionHandler: { | |
response, data, error in | |
if error != nil { | |
println("There was an error") | |
} else { |
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
let url = NSURL(string: "http://www.telize.com/geoip") | |
let urlRequest = NSURLRequest(URL: url) | |
let session = NSURLSession.sharedSession() | |
let task = session.dataTaskWithURL(url, | |
completionHandler: {data, response, error -> Void in | |
if error != nil { | |
println("error") | |
} else { |
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
// Drag | |
// Add UITableViewDelegate delegage | |
// class ViewController: UIViewController, UITableViewDelegate { | |
let people = ["Jim", "Joe", "Bob", "Jane"] | |
func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int { | |
return people.count | |
} |
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
## you need to create a bridging header: ParseExample-Bridging-Header.h | |
## #import <Parse/Parse.h> | |
Parse.setApplicationId("...", clientKey: "...") | |
var person = PFObject(className:"Person") | |
person.setObject("Joe", forKey: "firstname") | |
person.saveInBackgroundWithBlock{ |
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
// requires linked AVFoundation.framework | |
// don't forget to import AVFoundation at the top of your controller | |
var player:AVAudioPlayer = AVAudioPlayer() | |
var error: NSError? = nil | |
var p1sounds = NSURL(fileURLWithPath: NSBundle.mainBundle().pathForResource("filenamegoeshere", ofType: "mp3")!) | |
player = AVAudioPlayer(contentsOfURL: p1sounds, error: &error) | |
player.play() |
OlderNewer