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
# Framework Object::say_hello | |
class Object | |
def say_hello | |
"hello" | |
end | |
end | |
# Your Object class | |
class Object |
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
// fill with yellow | |
rectShape.fillColor = UIColor.yellowColor().CGColor | |
// 1 | |
// begin with a circle with a 50 points radius | |
let startShape = UIBezierPath(roundedRect: bounds, cornerRadius: 50).CGPath | |
// animation end with a large circle with 500 points radius | |
let endShape = UIBezierPath(roundedRect: CGRect(x: -450, y: -450, width: 1000, height: 1000), cornerRadius: 500).CGPath | |
// set initial shape |
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
float newTimer = 0; | |
SoundManager.PlaySound( "RisingSound", CameraControl.instance.transform.position); | |
fader.gameObject.SetActive( true ); | |
fader.color = Color.clear; | |
while (fader.color != Color.white) | |
{ | |
newTimer += Time.deltaTime; | |
fader.color = Color.Lerp( Color.clear, Color.white, newTimer * 0.33f ); | |
FaraDay.transform.localScale = Vector2.MoveTowards(FaraDay.transform.localScale, 3.0f * FaraDay.transform.localScale, 3 * Time.deltaTime); | |
yield return new WaitForEndOfFrame(); |
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
*** | |
Try using what you've learned so far to complete the code challenge: | |
{CodeChallenge} | |
{InitialCode} | |
<div id="anotherDiv"> This text is unchanged </div> | |
<script> | |
// Javascript code goes here | |
var myOtherDivVar = document.getElementById( {T}???{/T} ); |
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 | |
extension String { | |
func numsToCharsA() -> String { | |
return self.stringByReplacingOccurrencesOfString("1", withString: "a") | |
.stringByReplacingOccurrencesOfString("2", withString: "b") | |
.stringByReplacingOccurrencesOfString("3", withString: "c") | |
.stringByReplacingOccurrencesOfString("4", withString: "d") |
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
[Slide] | |
To write a comment, you can use // or /* */ | |
``` | |
/* Code blocks are just markdown */ | |
// Syntax highlighting is done automatically | |
``` | |
[Video fileName=explanationVideo.mp4 ] |
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
Slide | |
===== | |
A slide is just information. This is rich text produced from Markdown. Can include code segments. | |
Video | |
===== | |
A video in MP4 format | |
Regex | |
===== |
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
// Using LumaJSON | |
if let parsed = LumaJSON.parse(jsonStr) { | |
if let firstCommentText = parsed["user"]?["comments"]?[0]?["text"] as? String { | |
println("Luma First comment \(firstCommentText)") | |
} | |
} | |
// Using built-in JSON decoder | |
var err: NSError? | |
if let jsonDeserialized = NSJSONSerialization.JSONObjectWithData(jsonData, options: .MutableLeaves, error: &err) as? NSDictionary { |
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
// Complete code using LumaJSON | |
if let parsed = LumaJSON.parse(jsonStr) { | |
if let friend_ids = parsed["friend_ids"] as? [Int] { | |
println("Luma count: \(friend_ids.count)") | |
} | |
} | |
// Same functionality using built-in tools | |
var err: NSError? |
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
bool Grounded() { | |
int layerMask = 1 << playerLayerMask; | |
layerMask = ~layerMask; | |
RaycastHit hitInfo; | |
if( Physics.Raycast(transform.position, Vector3.down, out hitInfo, playerHeight, layerMask) ) { | |
return true; | |
} | |
return false; |