- We enforce a 50MB max in nginx
- We should add a configuration entry for the global max size of the metadata (we currently use max tarball size several places)
- A few guidelines I tried to follow:
- Identify and reject invalid requests as quickly as possible.
- Minimize the work done while holding a database connection, especially after entering the main transaction.
- The final main transaction may need to repeat some queries to ensure it doesn't rely on data obtained outside of the transaction.
$ dig -t ns crates.io | |
; <<>> DiG 9.10.6 <<>> -t ns crates.io | |
;; global options: +cmd | |
;; Got answer: | |
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 25517 | |
;; flags: qr rd ra; QUERY: 1, ANSWER: 4, AUTHORITY: 0, ADDITIONAL: 1 | |
;; OPT PSEUDOSECTION: | |
; EDNS: version: 0, flags:; udp: 512 |
- Go to rustup.rs and follow the instructions there. Rustup helps you keep Rust up to date.
- The Rust Programming Language book
- Read the Second Edition online for free!
- Report bugs or send in pull requests on the repo!
- Paper and eBook versions will be available from No Starch Press around October 2017.
# In your Backbone app, wherever you want -- we put this in lib/ajax_settings.coffee | |
define [ | |
'backbone', | |
'cookie' # This is https://github.com/js-coder/cookie.js, | |
# we have a bower-compatible fork at https://github.com/thinkthroughmath/cookie.js | |
], (Backbone, cookie) -> | |
init: -> | |
# This overrides all ajax requests sent through Backbone. We could have set this in jQuery | |
# since Backbone ultimately calls the jQuery ajax functions, but we decided we shouldn't be | |
# doing ajax requests outside of Backbone anyway. |
-
I'm using
rustc 1.9.0-dev (28c9fdafc 2016-04-11)
, cargo 0.10.0. Yes, I run nightly but don't update it every night. dealwithit.gif -
I wanted to get back to working on eeyore. Master compiles fine.
-
I want to use this branch of hubcaps I've been working on, and that I rebased on hubcaps master today.
-
I changed eeyore's Cargo.toml to use my collabs branch of hubcaps (
hubcaps = { git = "https://github.com/carols10cents/hubcaps", branch = "collabs" }
) and rancargo update
. Perhaps I should have runcargo update -p hubcaps
here... -
Now compiling eeyore, I get:
/Users/carolnichols/.cargo/registry/src/github.com-88ac128001ac3a9a/bodyparser-0.1.0/src/lib.rs:78:18: 78:21 error: the trait bound `persistent::Read<MaxBodyLength>: plugin::Plugin<iron::Request<'_, '_>>` is not satisfied [E0277]
/Users/carolnichols/.cargo/registry/src/github.com-88ac128001ac3a9a/bodyparser-0.1.0/src/lib.rs:78
fn save_status(text: &str) -> Result<i64, &'static str> { | |
if text.len() > 200 { | |
return Err("status is too long, must be under 200 bytes"); | |
} | |
let id = save_to_database(text)?; | |
// log id to server logs |
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)
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' |