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
#!/usr/bin/env bash | |
# git-merged | |
# Delete local branches that have been merged in | |
# Compare against current branch | |
branch="$(git branch --show-current)" | |
# Compare to branch, when merged in | |
head="$(git reflog show HEAD -1 | tail -n1 | awk '{ print $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
#!/usr/bin/env bash | |
# docker-ps | |
# Filter docker ps by service to get url | |
if [ "$#" -gt 0 ] | |
then | |
copy="$(\ | |
docker ps | \ | |
grep -n $@ | \ | |
perl -lne 'print "$1" while /[, ]?(0\.0\.0\.0:[0-9]{1,})/g;' | \ |
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
#!/usr/bin/env bash | |
# spellcheck | |
# use aspell to dump list of spellchecked words | |
cat $1 | # stdin | |
aspell -a -l en | # spellcheck with aspell | |
cut -d ' ' -f 2 | | |
grep -v '*' | # clean up aspell output | |
awk NF | # remove blank lines | |
sort | # sort |
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
#!/usr/bin/env bash | |
# git-changed | |
branch="master" | |
name_only="" | |
has_branch=0 | |
args="" | |
if [ $# -gt 0 ] | |
then |
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
#!/usr/bin/env python | |
# pass | |
# Generate password, with custom length | |
import sys | |
import secrets | |
import string | |
if not len(sys.argv) > 1: | |
length = 16 |
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
#!/usr/bin/env python | |
# secret-key | |
# Generate an app secret key | |
from base64 import b64encode | |
from os import urandom | |
random_bytes = urandom(64) | |
token = b64encode(random_bytes).decode() |
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
#!/usr/bin/env sh | |
# get-stream | |
youtube-dl -f best --get-url $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
#!/usr/bin/env bash | |
# check if websites (args passed) are up | |
for site in $@ | |
do | |
echo | |
echo $site | |
curl -I -s $site | head -n 1 | grep -q "404" && echo down || echo up |
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 CopyDown() { | |
var sheet = SpreadsheetApp.getActive(); | |
sheet.getCurrentCell().getNextDataCell(SpreadsheetApp.Direction.DOWN).activate(); | |
var currentCell = sheet.getCurrentCell(); | |
currentCell.activateAsCurrentCell(); | |
var rangeEnd = (sheet.getSelection().getNextDataRange(SpreadsheetApp.Direction.DOWN).getLastRow()) - currentCell.getRow(); | |
var range = sheet.getActiveSheet().getRange(currentCell.getRow(), currentCell.getColumn(), rangeEnd); | |
currentCell.copyTo(range, SpreadsheetApp.CopyPasteType.PASTE_VALUES, false); |
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 TrimText() { | |
var sheet = SpreadsheetApp.getActive(); | |
sheet.getActiveRange().trimWhitespace(); | |
}; |
OlderNewer