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 | |
echo "Installing XCode CLT..." | |
xcode-select --install | |
read -p "Press [Enter] key to once CLT finished..." | |
clear | |
echo "Creating dev environment..." | |
mkdir ~/dev | |
mkdir ~/dev/go | |
clear |
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
for dir in * | |
do | |
DIR=${dir} sh -c 'cd ${DIR}; git remote remove origin; git remote add origin [email protected]:n-marshall/companyname-${DIR}.git; git push -u origin master' | |
done |
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
hello |
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
fn passErr(err) ==> { throw err } | |
fn logErr(err) ==> { log.Error(err) } | |
fn ignoreErr(err) ==> {} | |
out1 := try SomeFunc1(arg1,arg2), catch logErr | |
out2 := try SomeFunc2(arg1), | |
catch passErr | |
out3 := try SomeFunc3(arg1). catch (err) ==> errwrap.wrapErr("additional error info") |
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
#![allow(non_snake_case)] | |
/// This rust lib contains one function that will flatten an array of arbitrarily nested arrays of integers into a flat array of integers. | |
/// e.g. [[1,2,[3]],4] -> [1,2,3,4]. | |
/// | |
/// # Example usage | |
/// | |
/// ``` | |
/// use rsflatten::{ | |
/// flatten, | |
/// Node::{Array as a, I32 as i}, |
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
3Box is a social profiles network for web3. This post links my 3Box profile to my Github account! | |
✅ did:muport:QmfHSJt3PBstq4hMHH99CWGSw3HrQymtCov6h4GdKqofaS ✅ | |
Create your profile today to start building social connection and trust online. https://3box.io/ |
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
function pgping() { | |
help_flags=(help -h --help) | |
if [[ ${help_flags[*]} =~ "$1" ]] || ([ -z "$1" ] || [ -z "$2" ]); then | |
echo "usage:" | |
echo | |
echo "pgping <server> <port> [<username>]" | |
return 0 | |
fi | |
PROTOCOL_VERSION="\x00\x03\x00\x00" |
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
for f in ./**/*.flac; do | |
# echo $f; | |
DIR=$(dirname "$f"); | |
NAME=$(basename "$f" | cut -d'.' -f1); | |
sox "${f}" -C 320 -S "${DIR}/${NAME}.mp3" | |
done | |
# or | |
# handles filenames with spaces |
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
# hash a dir | |
code_sha=$(shell echo $(shell find substrate-node-template -path "*target" -prune -type f -o -exec echo {} \; | xargs -I "{}" date -r {} "+%s") | $(shell [[ `uname`="Darwin" ]] &&echo "shasum -a 256" ||echo sha256sum) | cut -d" " -f1) | |
# get a dir's last modified timestamp | |
# ?rebuild=[[ $(shell date -r ${node} "+%s" || echo 0) -lt $(shell find substrate-node-template -print0 | xargs -0 -I "{}" date -r {} "+%s" | sort -nr | head -1 || echo 0) ]] # macos only |
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
impl Drop for MyStruct { | |
fn drop(&mut self) { | |
tokio::task::block_in_place(move || { | |
tokio::runtime::Handle::current().block_on(async move { | |
// self.client.cleanup(&mut *self.db.conn().await).await; | |
}); | |
}); | |
} | |
} |
OlderNewer