Skip to content

Instantly share code, notes, and snippets.

View tooshel's full-sized avatar
🏈
Hello! This status seems silly.

Sheldon McGee tooshel

🏈
Hello! This status seems silly.
View GitHub Profile
@tooshel
tooshel / gist:d5ca02076101d15ee1aa166728e23111
Created December 30, 2024 17:12
my favorite deploy script
# This stops the script on any error!
set -e
cd
mv Uplink*.zip old
rm -r build
myurl=`curl -s https://api.github.com/repos/<repo_name>/<repository>/releases/latest | grep "browser_download_url.*zip" | cut -d : -f 2,3 | tr -d \" `
echo $myurl
myfilename=`echo ${myurl##*/}`
echo $myfilename
  • Use curl to get the JSON response for the latest release
  • Use grep to find the line containing file URL
  • Use cut and tr to extract the URL
  • Use wget to download it
curl -s https://api.github.com/repos/jgm/pandoc/releases/latest \
| grep "browser_download_url.*deb" \
| cut -d : -f 2,3 \
| tr -d \" \
@tooshel
tooshel / signoff
Created April 30, 2024 05:26 — forked from dhh/signoff
#!/usr/bin/env bash
# Abort sign off on any error
set -e
# Start the benchmark timer
SECONDS=0
# Repository introspection
OWNER=$(gh repo view --json owner --jq .owner.login)

Stevey's Google Platforms Rant

I was at Amazon for about six and a half years, and now I've been at Google for that long. One thing that struck me immediately about the two companies -- an impression that has been reinforced almost daily -- is that Amazon does everything wrong, and Google does everything right. Sure, it's a sweeping generalization, but a surprisingly accurate one. It's pretty crazy. There are probably a hundred or even two hundred different ways you can compare the two companies, and Google is superior in all but three of them, if I recall correctly. I actually did a spreadsheet at one point but Legal wouldn't let me show it to anyone, even though recruiting loved it.

I mean, just to give you a very brief taste: Amazon's recruiting process is fundamentally flawed by having teams hire for themselves, so their hiring bar is incredibly inconsistent across teams, despite various efforts they've made to level it out. And their operations are a mess; they don't real

@tooshel
tooshel / .gitconfig
Last active August 29, 2015 14:11 — forked from donnfelker/.gitconfig
[user]
name = Sheldon McGee
email = [email protected]
[alias]
A = add -A
a = add
aa = add --all
ae = add --edit
ai = add --interactive
amend = commit --amend -C HEAD
@tooshel
tooshel / read
Last active August 29, 2015 13:58
var mongo = require('mongodb').MongoClient;
var settings = { mongo: "mongodb://cactuscon:[email protected]:29630/cactuscon-dcc" };
get("funstuff", function(err, data){
console.log(data);
});
function get(collectionname, callback){
mongo.connect(settings.mongo, function(err, db){
var collection = db.collection(collectionname);
var cursor = collection.find();
collection.find().toArray(function(err, results){
// Includes functions for exporting active sheet or all sheets as JSON object (also Python object syntax compatible).
// Tweak the makePrettyJSON_ function to customize what kind of JSON to export.
var FORMAT_ONELINE = 'One-line';
var FORMAT_MULTILINE = 'Multi-line';
var FORMAT_PRETTY = 'Pretty';
var LANGUAGE_JS = 'JavaScript';
var LANGUAGE_PYTHON = 'Python';