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
# Purpose: Find all the duplicate files recursively and delete them | |
# Recommended: review what will be deleted before running with `xargs rm` | |
find . -type f -exec md5sum {} \; > MD5SUMS | |
# Assumption: no whitespace in filenames | |
cat MD5SUMS | sort | awk '{ if (prev_md5==$1) { print $2 }; prev_md5=$1 }' | xargs rm | |
# Remove partially downloaded files that have filenames repeated in two different directories |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script> | |
let style = document.createElement("style") | |
style.innerHTML = ".noscript { display: none }" | |
document.head.appendChild(style) | |
</script> | |
</head> |
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
import { html, Component, render } from 'https://unpkg.com/htm/preact/standalone.module.js'; | |
class Clock extends Component { | |
constructor() { | |
super() | |
this.tick() | |
} | |
componentDidMount() { |
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/bash | |
# Based on https://gist.githubusercontent.com/chinmaya-n/cff02f1277c811deab2e550f2aad9967/raw/5d5511b6b61cb643f207f302fd370522e06948fd/bitbucket_to_github.sh | |
# Slightly manual but better than no automation | |
set -o errexit | |
# verify for two script params | |
if [ "$#" -ne 1 ]; then | |
echo "Need two arguments." | |
echo "Usage: ./bitbucket_to_github.sh <bitbucket_url>" |
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
# Simulates a race condition for testing. The first try always fails, the second try succeeds. | |
# | |
# Abstract example: | |
# | |
# RaceConditionCollection.new(active_record_model.associated_collection) | |
# | |
# Concrete example: | |
# | |
# RaceConditionCollection.new(blog_post.comments) | |
class RaceConditionCollection |
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
require 'json' | |
json=JSON.parse(File.read('Tasks.json')) | |
puts json['items'].map { |l| "\n\n**" + l['title'] + "**\n\n" + l['items'].reject { |t| t['deleted'] }.reject { |t| t['status'] == 'completed' }.map{|t| t['notes'] ? (t['notes'].match(/^http/) ? "[#{t['title']}](#{t['notes']}) #{t['due']}" : "#{t['title']} (#{t['notes']}) #{t['due']}") : "#{t['title']} #{t['due']}" }.join("\n")} |
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
gist_urls_file=$(mktemp) | |
gist -l | sed 's/ .*$//' > $gist_urls_file | |
cat $gist_urls_file | while read -r line; do | |
gist_url="$line" | |
gist_id="$(echo $gist_url | sed 's|https://gist.github.com/||')" | |
clone_url="[email protected]:$gist_id.git" | |
git clone $clone_url | |
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
# convert_wavs_to() { | |
# extension="$1" | |
# | |
# if [ ! -d "$extension" ]; then | |
# mkdir -p "$extension" | |
# | |
# for f in *.wav; do | |
# ffmpeg \ | |
# -i "$f" \ | |
# "$extension/$(basename "$f" .wav).$extension" |
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
// ==UserScript== | |
// @name Google Push to Talk | |
// @namespace http://tampermonkey.net/ | |
// @version 0.5 | |
// @description Hold down the spacebar to unmute the mic in Google Meet; tapping the spacebar toggles mute. | |
// @author Marc Reynolds (github.com/marcreynolds) | |
// @match https://meet.google.com/* | |
// @updateUrl https://gist.github.com/marcreynolds/6c629eaf8bfe87986ebe90ebea7daf85/raw/google-meet-spacebar.user.js | |
// @grant none | |
// ==/UserScript== |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<rss version="2.0"> | |
<channel> | |
<title>Asimov - Foundation Trilogy</title> | |
<description>Isaac Asimov's Foundation Trilogy in BBC Audio from the Internet Archive</description> | |
<item> | |
<title>Part 1 of 8</title> | |
<enclosure url="http://www.archive.org/download/IsaacAsimov-TheFoundationTrilogy/IsaacAsimov-Foundation1Of8_64kb.mp3" type="audio/mpeg"/> | |
</item> |
NewerOlder