This file contains hidden or 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
1. have a brilliant idea for something you want to use | |
2. Stop! Don't start building it. | |
3. Find a project that does something similar. (This likely exists) | |
4. Read it's documentation. | |
* If it has none, learn the project and create some. | |
* If it does, try to build something with it and document what wasn't clear. | |
5. If it feels broke. Write some failing tests, | |
* If possible, fix them, then open a pr | |
* If not, open a pr with failing tests and get the maintainer to teach you how to fix them | |
6. Document your process for contributing in a file called CONTIBUTING.md |
This file contains hidden or 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
Foo ■■■■■■ | |
Foo ■ | |
Foo. ■■■ | |
Foo ■■ |
This file contains hidden or 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 | |
curl --progress \ | |
"https://s3.dualstack.us-east-2.amazonaws.com/aws-xray-assets.us-east-2/xray-daemon/aws-xray-daemon-linux-2.x.zip" \ | |
-o /tmp/xray.zip \ | |
&& unzip -f /tmp/xray.zip \ | |
&& rm /tmp/xray.zip |
This file contains hidden or 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] | |
extern crate serde; | |
extern crate serde_json; | |
use serde::Serializer; | |
fn comma_delim<S>( | |
x: &Option<Vec<String>>, | |
ser: S, | |
) -> Result<S::Ok, S::Error> |
This file contains hidden or 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
xcode-select --install |
This file contains hidden or 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/env bash | |
# git branch freshness test. | |
# branch-rot.sh [expiration-date-epoc-seconds] | |
# default expiration date is about one month ago | |
# seconds*minutes*hours*days*weeks*months ~ one month ago | |
expiration_date=$(( $(date +%s) - 60*60*24*7*4 )) | |
if [[ $# -eq 1 ]]; then | |
expiration_date=$1 | |
fi |
This file contains hidden or 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
require 'net/http' | |
def instance_zone | |
uri = URI("http://metadata.google.internal/computeMetadata/v1/instance/zone") | |
req = Net::HTTP::Get.new(uri) | |
req['Metadata-Flavor'] = 'Google' | |
begin | |
resp = Net::HTTP.start(uri.hostname, uri.port) { |http| http.request(req) } | |
resp.body.split("/").last | |
rescue Exception => msg | |
puts "failed to request instance zone: #{msg}" |
This file contains hidden or 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
# vscode rust seti[ | |
use vscode-rust ( not rusty ) | |
rustup component install rust-src | |
rustup component install rust-docs | |
rustup update | |
rustup which rust-src ( save this path ) | |
cargo install --force racer | |
cargo install --force rustfmt | |
cargo install --force rustsym |
This file contains hidden or 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 | |
jarfile1=$1 | |
jarfile2=$2 | |
tmpdir=`mktemp -d -t jiff-XXX` | |
echo $tmpdir | |
mkdir -p $tmpdir/{dir1,dir2} | |
cp $jarfile1 $tmpdir/dir1 | |
cp $jarfile2 $tmpdir/dir2 | |
cd $tmpdir/dir1 | |
jar xvf $(basename $jarfile1) |
This file contains hidden or 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
// env! gets inserted at compile time, not run time | |
// https://doc.rust-lang.org/std/macro.env.html | |
const BUILD: &str = env!("BUILD_NUM"); | |
fn main() { | |
println!("was built with {}", BUILD); | |
} |