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
fn main() { | |
{ | |
// simple things like integers are copied b/c they are fixed in size | |
let x = 5; | |
let y = x; | |
println!("{} + {} = {}", x, y, x + y); // this works b/c ints are simple values with a known fixed size | |
// this is not true for things like strings. | |
let mut s = String::from("hello"); | |
s.push_str(", world!"); | |
println!("{}", s); |
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
fn main() { | |
{ | |
// simple things like integers are copied b/c they are fixed in size | |
let x = 5; | |
let y = x; | |
println!("{} + {} = {}", x, y, x + y); // this works b/c ints are simple values with a known fixed size | |
// this is not true for things like strings. | |
let mut s = String::from("hello"); | |
s.push_str(", world!"); | |
println!("{}", s); |
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 main() { | |
Human jenny = Human(age: 32, firstName: "Jenny", lastName: "Swanson"); | |
jenny.firstName = "Jenny"; | |
jenny.talk("Hey, you're cute!"); | |
Human paul = Human(age: 38, firstName: "Paul", lastName: "McGovern"); | |
paul.talk("My name is Paul, what's yours?"); | |
Car myFirstCar = Car(); | |
myFirstCar.drive(); |
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
<!-- Still in progress. At this point it only parses headers and links - also, can't handle more than one link per line --> | |
<div id="app"> | |
<h1>Markdown Parser</h1> | |
<span>Write markdown here:</span> | |
<textarea name="markdown-text" id="md-text" rows="7"> </textarea> | |
</div> | |
<span>Results appear here:</span> | |
<div id="result"></div> |
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
class Person { | |
String name; | |
int age; | |
/// A class for making people. Accepts a [name] and an [age] | |
Person(String name, int age) { | |
this.name = name; | |
this.age = age; | |
} | |
} |
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 main() { | |
print(tribonacciTime([0, 0, 1], 10)); | |
print(find([1, 3, 4, 5, 7])); | |
print(find([2, 4, 5, 6])); | |
} | |
// Find the outlier | |
int find(List integers) { | |
var evens = 0; | |
for (int ctr = 0; ctr <= 2; ctr++) { |
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
<nav class="navbar" role="navigation" aria-label="main navigation"> | |
<div class="navbar-brand"> | |
<a class="navbar-item" href="https://dewofyouryouth.github.io/"> | |
<img src="https://dewofyouryouth.github.io/doyy.png" height="50"> | |
</a> | |
<a role="button" class="navbar-burger burger" aria-label="menu" aria-expanded="false" data-target="navbarBasicExample"> | |
<span aria-hidden="true"></span> | |
<span aria-hidden="true"></span> | |
<span aria-hidden="true"></span> |
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
<div class="wrap"> | |
<div class="jumbotron"> | |
<h1 class="display-2 text-center">Vue Todo</h1> | |
<h2 class="text-center"> -- Basic ---</h2> | |
</div> | |
</div> | |
<div id="app" class="container"> | |
<h3 class="text-center">Instructions:</h3> | |
<p class="text-center"> |
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
const object1 = { | |
'50': 'somestring', | |
'100': 42, | |
'25': false | |
}; | |
var numsArr = [1, 34, 68.5, 33]; | |
// Returns an array of the keys - then maps then to get the values by key |
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
// Example of function | |
String addNumbers(int num1, int num2){ | |
return('${num1} + ${num2} = ${num1 + num2}'); | |
} | |
// A basic class w/ attribute | |
class Person { | |
String fname; | |
String lname; | |
int age; |