Skip to content

Instantly share code, notes, and snippets.

View softprops's full-sized avatar
®️
Rustling

Doug Tangren softprops

®️
Rustling
View GitHub Profile
@softprops
softprops / steps.txt
Created April 9, 2018 05:41
Steps to build an awesome ecosystem
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
Foo ■■■■■■
Foo ■
Foo. ■■■
Foo ■■
#!/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
#[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>
xcode-select --install
#!/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
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}"
# 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
#!/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)
// 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);
}