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 | |
if [ "$#" -lt 1 ]; then | |
echo "Please provide dir to create the root file system in" | |
exit 1 | |
fi | |
ROOT=$1 |
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
#[derive(Debug, Clone, Default)] | |
pub struct User{ | |
} | |
#[derive(Debug, Clone, Default)] | |
pub struct Profile{ | |
} | |
#[derive(Default)] |
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/sh | |
# To use, store as .git/hooks/pre-commit inside your repository and make sure | |
# it has execute permissions. | |
gofiles=$(git diff --cached --name-only --diff-filter=ACM | grep '.go$') | |
if [ ! -z "$gofiles" ]; then | |
unformatted=$(goimports -l $gofiles) |
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
package main | |
import ( | |
"encoding/base64" | |
"encoding/json" | |
"fmt" | |
"log" | |
"net/http" | |
) |
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
pub fn auth( | |
provider: AuthProvider, | |
) -> impl Filter<Extract = (Context,), Error = warp::Rejection> + Clone { Ok(Context{})} | |
fn routes( | |
ap: &AuthProvider, | |
) -> impl Filter<Extract = impl warp::Reply, Error = Infallible> + Clone { | |
let g = auth(ap.clone()) | |
.and(warp::get()) | |
.and_then(get_handler); |
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
gcloud beta container subnets list-usable --project myproject --format json | \ | |
jq '.[] | select(.network | endswith("mynetwork")) | .ipCidrRange ' -r | \ | |
sort -n -t . -k 1,1 -k 2,2 -k 3,3 -k 4,4 | |
10.0.0.0/24 | |
10.0.1.0/27 | |
10.0.1.32/27 | |
10.0.1.64/27 | |
10.0.1.96/27 | |
gcloud beta container subnets list-usable --project myproject --format json | \ |
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
" HOW TO DO 90% OF WHAT PLUGINS DO (WITH JUST VIM) | |
" Max Cantor | |
" NYC Vim Meetup -- August 3, 2016 |
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
pub fn create_hgrm(hist: &Histogram<u32>, w: &mut ::std::io::Write) -> Result<(), io::Error> { | |
w.write_all( | |
format!( | |
"{:>12} {:>14} {:>10} {:>14}\n\n", | |
"Value", | |
"Percentile", |