Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View jspiro's full-sized avatar
:shipit:
const application:Application = Application(Application.application); // Sigh.

Jono Spiro jspiro

:shipit:
const application:Application = Application(Application.application); // Sigh.
View GitHub Profile
@jspiro
jspiro / .gitconfig
Created January 30, 2013 00:23
gitconfig for cmdline gist using keychain stored password
[github]
user = jspiro
password = !security find-internet-password -gs github.com -w | tr -d '\n'
[gist]
private = true

Keybase proof

I hereby claim:

  • I am jspiro on github.
  • I am jspiro (https://keybase.io/jspiro) on keybase.
  • I have a public key whose fingerprint is 8949 AD7D 34AE 2BC7 EDA0 9714 7EAF 5E8E CE7B F43F

To claim this, I am signing this object:

[
["f", "Show next/latest diffs", "setProposedRevRanges()"],
[null, "Next unreviewed file", "nextUnreviewedFile()"],
[null, "Previous unreviewed file", "prevUnreviewedFile()"],
["n", "Next personally unreviewed file", "nextPersonallyUnreviewedFile()"],
["shift+n", "Previous personally unreviewed file", "prevPersonallyUnreviewedFile()"],
["alt+n", "Next changed file", "nextChangedFile()"],
["alt+shift+n", "Previous changed file", "prevChangedFile()"],
[null, "Next visible file", "nextVisibleFile()"],
@jspiro
jspiro / .gitconfig
Created May 18, 2017 04:02
git aliases for managing autogenerated code
# autogen files are files with diff unset in .gitattribute
ls-check-attr-diff = "!git ls-files --exclude-standard --modified | git check-attr --stdin diff"
ls-autogen = "!git ls-check-attr-diff | grep 'diff: unset' | sed 's/: diff:.*//'"
ls-no-autogen = "!git ls-check-attr-diff | grep -v 'diff: unset' | sed 's/: diff:.*//'"
discard-autogen = "!git ls-autogen | xargs git checkout --"
add-autogen = "!git ls-autogen | xargs git add"
add-no-autogen = "!git ls-no-autogen | xargs git add"
@jspiro
jspiro / todo-count.sh
Created July 12, 2017 00:09
Generate CSV of TODOs by user in Git
#!/usr/bin/env bash
revs=$(git rev-list "$1" | wc -l | awk '{ printf "%d\n", $0 }')
revnum=0
ignores="--ignore todo-count.sh --ignore out.csv --ignore thirdparty --ignore govendor"
people=( "sarietta" "cjrd" "jspiro" "avi" )
echo "date,sha,file count,todo count,$(printf "%s," "${people[@]}")" > out.csv
while read -r rev; do
@jspiro
jspiro / coffeelint.css
Created March 5, 2019 23:05
coffeelint.org snapshot 9/19
* {
padding:0;
margin:0;
}
html {
width:100%;
}
body {
#!/bin/sh
sudo nvram StartupMute=%00
@jspiro
jspiro / login-to-artifactory.sh
Last active May 13, 2020 06:22
CLI tool to log in to Artifactory NPM
#!/bin/sh
scope=company-name
any_scoped_package_name=secret_package
url=artifactory.company.com
repo=npm
cd "$(dirname "$0")" || exit
echo Please enter your email address:
read -r email
@jspiro
jspiro / dedupe.sh
Created May 18, 2020 09:34 — forked from tvwerkhoven/dedupe.sh
De-duplicate using APFS clonefile(2) and jdupes in zsh
#!/usr/bin/env zsh
#
# # About
# Since APFS supports de-duplication on block-level, it can be useful to
# manually de-duplicate your files if you've migrated/upgrade to APFS not
# using a fresh install.
#
# I've written this simple script with the aim to:
# - Be simple, easy to read and understand (for users to check)
# - Use native cp -c for de-duplication
@jspiro
jspiro / gist:729e64e451d05ba3ce655a34cfb43d2a
Last active June 16, 2020 22:32
horrific but working way to summarize file sizes in a directory for evaluating what's tracked by git lfs
$ find . -type f -name '*.*' |
sed 's/.*\.//' |
sort -u |
while read ext; do
(
gfind . -name "*$ext" -printf "%s\n" |
sed 's/$/+/' |
tr -d '\n'
echo 0
) | bc | tr -d '\n'