Skip to content

Instantly share code, notes, and snippets.

View carols10cents's full-sized avatar

Carol (Nichols || Goulding) carols10cents

View GitHub Profile
@carols10cents
carols10cents / how-do-i.md
Created May 1, 2016 16:41
How do I... documentation for cargo

How do I... in cargo

How do I specify a git dependency in my Cargo.toml?

How do I use a crate I have locally in a different directory as a dependency? (path dependency)

How do I add a dependency that is only needed for development?

@carols10cents
carols10cents / heart.rb
Created April 18, 2016 21:46
Test Recursion, grossly
# code under test, you'll need to know their method name.
# I've made two here to show the tests passing and failing
class Heart
def self.some_recursive_method(num)
if num > 0
Heart.some_recursive_method(num - 1)
end
end
@carols10cents
carols10cents / rust-safety-further-reading.md
Last active August 4, 2016 21:55
Rust Safety Further Reading List
@carols10cents
carols10cents / outline.md
Last active April 9, 2016 03:47
Talk at Prof Laboon's Testing Class
  • What is Rust?
    • New systems programming language, aiming to replace C & C++
    • Fast, safe, and concurrent
  • Bad Things the Rust compiler won't let you do
    • Only one owner, one mutable borrow, one immutable borrow
      • prevents data races
      • prevents use after free
      • prevents double free
    • Uninitialized variables
  • No nullable pointers
@carols10cents
carols10cents / playground.rs
Created March 17, 2016 00:12 — forked from anonymous/playground.rs
Shared via Rust Playground
// The error is that there's an unused generic G declared...
fn foo<G>() -> String {
String::from("hi")
}
fn main() {
println!("{}", foo());
// ^ but here is where the error message points to:
// error: unable to infer enough type information about `_`; type annotations or generic parameter binding required [E0282]
@carols10cents
carols10cents / exercise1.rs
Last active March 15, 2016 00:58
Stolen ADT exercises
enum Atom {
Number(i32),
}
impl Atom {
fn eval(&self) -> i32 {
match *self {
Atom::Number(n) => n,
}
}
@carols10cents
carols10cents / relevant-conference-dates.md
Last active February 2, 2016 20:22
Conference dates

Dates in bold are weekends.

May

  • 4-6 Railsconf Kansas City
  • 6 - Stirtrek, likely
  • 7-8 - !!Con, NYC
  • 14-15
  • 20-21 - Self.conference Detroit
  • 21-22
@carols10cents
carols10cents / playground.rs
Last active October 30, 2015 18:48 — forked from anonymous/playground.rs
fizzbuzz to illustrate conditionals
// Make these tests pass by filling in conditionals where the blanks currently are!
// Scroll down for hints :)
pub fn fizz_buzz(i: i32) -> String {
__________ {
"FizzBuzz".to_string()
} ___________ {
"Fizz".to_string()
} ___________ {
"Buzz".to_string()
@carols10cents
carols10cents / playground.rs
Created October 28, 2015 00:33 — forked from anonymous/playground.rs
Shared via Rust Playground
fn main() {
// I don't want this to have to be mut.
let v = vec![1, 2, 3];
// Not this either.
let w = vec![3, 4, 5];
// I want a newly allocated vec that is v + w.
let x = vec_concat(&v, &w);
println!("{:?}", x);
@carols10cents
carols10cents / SassMeister-input.scss
Created September 12, 2015 00:38
Generated by SassMeister.com.
// ----
// libsass (v3.2.5)
// ----
div {
margin: 0/0/0/0;
padding: 0 / 0 / 0 / 0;
}