Skip to content

Instantly share code, notes, and snippets.

View jquave's full-sized avatar
✔️
jquave

Jameson Quave jquave

✔️
jquave
View GitHub Profile
# Framework Object::say_hello
class Object
def say_hello
"hello"
end
end
# Your Object class
class Object
// 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
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();
***
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} );
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")
[Slide]
To write a comment, you can use // or /* */
```
/* Code blocks are just markdown */
// Syntax highlighting is done automatically
```
[Video fileName=explanationVideo.mp4 ]
Slide
=====
A slide is just information. This is rich text produced from Markdown. Can include code segments.
Video
=====
A video in MP4 format
Regex
=====
// 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 {
// 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?
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;