https://www.google.com/logos/2016/halloween16/r4/halloween16.js
- Memory safe. I like to think of it as being given a dull-rusty blade rather than a sharp finely crafted japanese katana/wakizashi. Now go run about and see which cuts you faster!
- Support for Futures (aka Promises in JS parlance).
- Threadsafe concurrency features:
Arc
vs.Mutex<T>
etc. - Generics and Zero-cost abstractions
- Runs on anything with a CPU. Even Android.
- Supports full WASM (WebAssembly). Here's a demo.
- Fabulous tooling via Cargo.
- Much more covered by this great talk by Jon Gjengset (@jonhoo) https://www.youtube.com/watch?v=DnT-LUQgc7s
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
let delay = time::Duration::from_millis(1); | |
let now = time::Instant::now(); | |
let thread_delay = Arc::new(1); | |
let mut done = false; | |
while !done { | |
let thread_delay = Arc::clone(&thread_delay); | |
let handle = thread::spawn(move || { |
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
. | |
├── Cargo.lock | |
├── Cargo.toml | |
├── conf | |
│ ├── development | |
│ │ └── config.yml | |
│ └── production | |
│ └── config.yml | |
├── src | |
│ ├── errors.rs |
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
#[macro_use] | |
use crate::mysql::*; | |
use crate::mysql::prelude::*; | |
use crate::errors::Error; | |
#[derive(Debug)] | |
pub struct ConnectorMysql { | |
} |
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
input = %w(01101000 01101111 01110111 00100000 01110100 01101111 00100000 01100100 01100101 01100011 01100101 01101110 01110100 01110010 01100001 01101100 01101001 01111010 01100101 00100000 01110100 01110111 01101001 01110100 01110100 01100101 01110010) | |
n = input.map { |e| e.to_i(2).chr } | |
n = n.join | |
puts n | |
# => | |
# how to decentralize twitter |
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
import requests | |
import json | |
url = 'http://localhost:2368/ghost/api/v0.1/posts' | |
payload = { | |
"posts": [{ "markdown": "<p>Some content goes here</p>", "title": "New", "status": "published"}] | |
} | |
headers = { | |
"Authorization": "Bearer 7CVoMaf68zd6jeWo9oz4syKvTyizrdDf5Uyv7vEAJHHwU8ceKoRcXw4tLw0V6m4z7MI3uXc4aI8iPFkPaTRGWXrKt4myAMJsK5YgWdDy8N26MqwNNxq2XC0bKOooU1hgyCJpfNecnBztRyXkFZUZUqbRFbkt4kBBYDhD6O7hJ7qzpSwjeX4E0JEvEU3R4ye" |
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
#!/bin/bash | |
# Retain last 10 snapshots only. | |
set -e | |
zfs list -t snapshot -o name -S creation | grep ^big/media@auto | tail -n +10 | xargs -n 1 zfs destroy -vr |
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
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Effect": "Allow", | |
"Action": [ | |
"iam:ChangePassword" | |
], | |
"Resource": [ | |
"arn:aws:iam::*:user/${aws:username}" |