Skip to content

Instantly share code, notes, and snippets.

View carols10cents's full-sized avatar

Carol (Nichols || Goulding) carols10cents

View GitHub Profile
fn main() {
let s = String::from("book");
// Add code here that calls the pluralize function
println!(
"I have one {}, you have two {}",
s,
you_add_something_here,
);

I currently have this working diesel code:

    let recent_downloads = sql::<Nullable<BigInt>>("SUM(crate_downloads.downloads)");
    let most_recently_downloaded = crates
        .left_join(
            crate_downloads::table.on(id.eq(crate_downloads::crate_id)
                .and(crate_downloads::date.gt(date(now - 90.days())))),
        )
        .group_by(id)
@carols10cents
carols10cents / abstract.md
Created December 3, 2017 16:16
Morgantown codes abstract

What is this Rust thing anyway?

Rust is a new systems programming language out of Mozilla research aiming to be a safer alternative to C and C++ without sacrificing performance. Come learn how Rust prevents buffer overflows, ensures memory safety, and prevents data races while also providing modern development workflows through Cargo and an ever-growing ecosystem of open source libraries on Crates.io. Hear about how companies like Mozilla, npm, Dropbox, and Chucklefish are using Rust to make better software. Discover how you can get involved with Rust's friendly community!

curl 'https://api.github.com/teams/866115/memberships/Manishearth' -H 'Accept: application/vnd.github.v3+json' -H 'User-Agent: hello!' -H 'Authorization: token INSERTTOKENHERE'
@carols10cents
carols10cents / output.json
Created September 26, 2017 19:50
Part of the output of `cargo build --message-format=json` for a project with `src/bin/server.rs`
{
"features":[],
"filenames":["/Users/carolnichols/rust/crates.io/target/debug/server"],
"fresh":false,
"package_id":"cargo-registry 0.2.1 (path+file:///Users/carolnichols/rust/crates.io)",
"profile":{"debug_assertions":true,"debuginfo":2,"opt_level":"0","overflow_checks":true,"test":false},
"reason":"compiler-artifact",
"target":{
"crate_types":["bin"],
"kind":["bin"],
{:timeout,
{GenServer, :call,
[BorsNG.GitHub,
{:synthesize_commit, {{:installation, 42672}, 21365581},
{%{branch: "staging.tmp", commit_message: "[ci skip]",
parents: ["314f793078cf83b535700686fd12e47ceee4b0c3"],
tree: "c4b1dd792ff25424a26818434dcfa6df68c9070b"}}},
5000]}}
select count(distinct crate_owners.owner_id)
from crates
join crate_owners
on crates.id = crate_owners.crate_id
where date(crates.created_at) >= '2016-05-15'
and crate_owners.owner_id NOT IN (
select distinct crate_owners.owner_id
from crates
join crate_owners
on crates.id = crate_owners.crate_id

These exit successfully:

  • cargo build
  • cargo build --release
  • cargo test

These result in a compiler error:

  • cargo publish
  • cargo package
@carols10cents
carols10cents / learn-rust.md
Last active October 28, 2019 13:21
Carol's Recommended Resources for learning Rust

Installing Rust

  • Go to rustup.rs and follow the instructions there. Rustup helps you keep Rust up to date.

Learning Rust

@carols10cents
carols10cents / playground.rs
Last active February 16, 2017 02:59 — forked from anonymous/playground.rs
to break your brain again again
fn main() {
let z = 3;
let mut p = &z;
{
let x = 5;
p = &x;
p = &z;
}