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
struct Position { line: usize, col: usize } | |
fn report<P>(path: P, content: &str, pos: &Position, error: &str) | |
where | |
P: AsRef<Path>, | |
{ | |
let Position { line, col } = pos; | |
println!( | |
"{}", | |
format!("--> {}:{}:{}", path.as_ref().display(), line, col).dimmed() |
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
✈ sudo gem update --system | |
Updating RubyGems | |
Updating rubygems-update | |
Successfully installed rubygems-update-1.8.15 | |
Updating RubyGems to 1.8.15 | |
Installing RubyGems 1.8.15 | |
Invalid gemspec in [/Library/Ruby/Gems/1.8/specifications/heroku-2.16.1.gemspec]: invalid date format in specification: "2011-12-09 00:00:00.000000000Z" | |
Invalid gemspec in [/Library/Ruby/Gems/1.8/specifications/heroku-2.16.2.gemspec]: invalid date format in specification: "2011-12-13 00:00:00.000000000Z" | |
Invalid gemspec in [/Library/Ruby/Gems/1.8/specifications/heroku-2.16.1.gemspec]: invalid date format in specification: "2011-12-09 00:00:00.000000000Z" | |
Invalid gemspec in [/Library/Ruby/Gems/1.8/specifications/heroku-2.16.2.gemspec]: invalid date format in specification: "2011-12-13 00:00:00.000000000Z" |
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
#!/usr/bin/env bash | |
# discover what values you can use for a given service in the last 3 months | |
# | |
# aws ce get-dimension-values \ | |
# --dimension SERVICE \ | |
# --time-period Start=$(date -v-3m +%Y-%m-01),End=$(date +%Y-%m-01) \ | |
# --query 'DimensionValues[*].Value' | |
# last 3 months of ecr usage/spend |
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
~/c/r/binsize ❯❯❯ rustc --version | |
rustc 1.31.1 (b6c32da9b 2018-12-18) | |
~/c/r/binsize ❯❯❯ cat src/main.rs | |
fn main() { | |
println!("Hello, world!"); | |
} | |
~/c/r/binsize ❯❯❯ cargo build | |
Finished dev [unoptimized + debuginfo] target(s) in 0.06s | |
~/c/r/binsize ❯❯❯ du target/debug/binsize | |
576K target/debug/binsize |
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
var console = { | |
log: function (msg) { | |
java.lang.System.out.println(msg); | |
} | |
}; |
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
case class Counter(x: Int = 0) | |
/** A type class for combining types through aggregation */ | |
sealed trait Aggregate[As, Elem] { | |
def apply(el: Elem): As | |
def empty: As | |
def apply(as: As, el: Elem): As | |
} | |
/** A companion to Aggregate exposing a single method, `values` |
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
extern crate envy_store; | |
#[macro_use] | |
extern crate serde_derive; | |
extern crate tokio; | |
use tokio::runtime::Runtime; | |
// parameter names map to field names | |
#[derive(Deserialize, Debug)] | |
struct Config { |
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": [ | |
"ssm:GetParametersByPath" | |
], | |
"Resource": "arn:aws:ssm:<region>:<account>:parameter/grand-rustacean-central/*" | |
} |
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
# store a secure string | |
$ aws ssm put-parameter \ | |
--name /demo/foo | |
--value bar | |
--type SecureString | |
# store a string list | |
$ aws ssm put-parameter \ | |
--name /demo/bar \ | |
--value baz,boom,zoom \ | |
--type StringList |
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
libraryDependencies += Seq( | |
"net.databinder" %% "unfiltered-filter" % "0.5.1", | |
"net.databinder" %% "unfiltered-jetty" % "0.5.1", | |
) |