This file contains hidden or 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 ruby | |
require 'net/http' | |
require 'timeout' | |
# A Ruby script to find broken links. | |
# | |
# Not perfect, but it gets the job done. | |
# The output from STDOUT can be used as a CSV: | |
# | |
# ruby find_broken_links.rb > broken_links.csv |
This file contains hidden or 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
/** | |
* Download the latest json-java.jar from https://github.com/stleary/JSON-java#readme | |
* Place it in the same folder as this file | |
* | |
* Compile (Windows): javac -cp .;json-java.jar ParseJson.java | |
* Compile (Unix): javac -cp .:json-java.jar ParseJson.java | |
* | |
* Run (Windows): java -cp .;json-java.jar ParseJson FILENAME.json | |
* Run (Unix): java -cp .:json-java.jar ParseJson FILENAME.json | |
*/ |
This file contains hidden or 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 python3 | |
import sys | |
import json | |
if len(sys.argv) < 2: | |
print("Usage: parse_json.py FILENAME.json") | |
exit(1) | |
filename = sys.argv[1] |
This file contains hidden or 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 node | |
const fs = require('fs'); | |
const filename = process.argv[2]; | |
if (filename == null) { | |
console.log("Usage: parse_json.js FILENAME.json") | |
process.exit(1); | |
} |
This file contains hidden or 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 ruby | |
require 'json' | |
if ARGV[0].nil? | |
puts 'Usage: parse_json.rb FILENAME.json' | |
exit 1 | |
end | |
data = JSON.load_file(ARGV[0], symbolize_names: true) |
This file contains hidden or 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 ruby | |
# Define the "commit message ratio" as (commit_body_words / commit_lines_changed). | |
# | |
# With no args, this script will find the commit message ratio of all commits in | |
# the git repo in the pwd, and will sort them by that ratio. | |
# (Commits with a high commit message ratio tend to be interesting commits!) | |
# | |
# With a commit hash as the only arg, provide the commit message ratio of that commit. | |
# |
This file contains hidden or 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 ruby | |
require 'optparse' | |
require 'json' | |
metadata = {} | |
TARGET_I = "-16" | |
TARGET_TP = "-1.5" | |
TARGET_LRA = "11" | |
SAMPLE_RATE = "44100" | |
BITRATE = "128k" |
This file contains hidden or 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
.PHONY: help image test shell clean | |
DIR:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST)))) | |
help: | |
@echo "Usage: make [target]" | |
@echo "" | |
@echo "Targets:" | |
@echo " help Print this help message." | |
@echo " image Build the my-project:latest Docker image." | |
@echo " shell Open a shell inside the Docker container." |
This file contains hidden or 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 | |
# Keep this script in a directory with the master copy of your dotfiles. | |
# For example, keep this script in a dotfiles folder in your Dropbox. | |
# Run this script to diff your dotfiles between the master copy (in the pwd) | |
# and the dotfiles installed at ~. | |
show_help() { | |
cat <<EOF | |
Usage: diff-dotfiles.sh OPTION [filename] |
This file contains hidden or 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 ruby | |
require 'time' | |
usage = """ | |
Usage: date_shift.rb SECONDS FILE | |
Look for dates like 2020-06-01T12:26:41Z in FILE | |
and shift all of them by SECONDS. Print the result to | |
STDOUT. |
NewerOlder