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
# https://static.nytimes.com/newsgraphics/2022/01/25/wordle-solver/assets/solutions.txt | |
# current contents: | |
# Hello! WordleBot previously had a data file called solutions.txt that it once used for certain calculations. It was no longer used, and no longer accurate. We decided to empty this outdated file so it's not confused with any kind of an official solutions list. | |
# If you're looking for an alternative, you can use a search engine to find many third-party tools and lists that can help you identify words to guess in Wordle, using a variety of techniques and criteria. | |
# original data: | |
aback | |
abase | |
abate |
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/zsh | |
# requires ffmpeg: https://ffmpeg.org/download.html | |
# clear the file list | |
echo "" > ./output.txt | |
# recursively find all mp4 files in the current directory and subdirectories | |
# (will preserve alphabetical order by full path) | |
for entry in ./**/*.mp4 |
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
// https://www.onlinegdb.com/online_c++_compiler | |
// https://stackoverflow.com/questions/35404932/stdvectoremplace-back-and-stdmove | |
// https://stackoverflow.com/questions/11572669/move-with-vectorpush-back | |
#include <iostream> | |
#include <utility> | |
#include <vector> | |
int main() | |
{ |
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
// Source: https://webapps.stackexchange.com/a/117682 | |
// Docs: https://developers.google.com/apps-script/reference/document/ | |
// Add new menu item | |
function onOpen() { | |
DocumentApp.getUi() | |
.createMenu('Styles') | |
.addItem('Format Code', 'formatCode') | |
.addToUi(); | |
} |
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/swift | |
// ExifTag.swift | |
// Scans files in the given directory and any subdirectories for EXIF metadata and applies | |
// macOS tags based on the results. | |
// | |
// Usage: | |
// swift ExifTag.swift [options] path | |
// or... | |
// chmod +x ExifTag.swift |
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
// ArchiveInboxThreads | |
// | |
// This Google Apps Script moves all threads containing any label in the labelsToArchive list out of the | |
// user's inbox, except for threads that also have a label from the labelsToPreserve list. | |
// | |
// If numInboxThreadsToProcess is set to a value greater than 0, the script will only examine that number | |
// of the most recent inbox threads when it runs; otherwise, it will examine every thread in the inbox. | |
// | |
// To use this script, visit https://script.google.com/home and click "New script", | |
// then paste this code into the text editor area and edit the "labelsToArchive" and "labelsToPreserve" |
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
[alias] | |
add-branch = "!f(){ git fetch origin $1 && git branch $1 FETCH_HEAD && git checkout $1; }; f" | |
alias = "!f(){ git config --global alias.$1 \"$2\"; }; f" | |
aliases = config --get-regexp ^alias\\. | |
aliasverbose = "!sh -c '[ $# = 2 ] && git config --global alias.\"$1\" \"$2\" && exit 0 || echo \"usage: git alias <new alias> <original command>\" >&2 && exit 1' -" | |
br = branch --contains | |
cherry-pick-external = "!f(){ git --git-dir=$1/.git format-patch -k -1 --stdout $2 | git am -3 -k; }; f" | |
cleanup = gc | |
cleanup-slow = gc --aggressive | |
curr-branch = symbolic-ref --short 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
#!/usr/bin/swift | |
// shell.swift | |
// A simple script to demonstrate some basics of Swift scripting. | |
import Foundation | |
// Docs: https://developer.apple.com/documentation/foundation | |
// ...and: https://github.com/apple/swift-corelibs-foundation/blob/master/Docs/Status.md | |
extension CommandLine { |
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 Foundation | |
#if swift(>=4.2) | |
// no shim necessary | |
#else | |
// add shims for swift-4.2-style random(in:) methods | |
// NOTE: unlike Swift 4.2's implementations, these versions are prone to modulo bias, | |
// are not cryptographically secure, and don't support the full range of Int64 values | |
#if os(Linux) | |
srandom(UInt32(time(nil))) |
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
@echo off | |
set /p filename="Enter GIF filename (without .gif extension) to resize: " | |
set /p scale="Enter scale to resize by (eg. 0.5): " | |
set /p colors="Enter color palette size to use (between 2 and 256): " | |
@echo on | |
gifsicle-1.89-win64\gifsicle.exe --scale %scale% --colors %colors% -O3 --no-extensions %filename%.gif > %filename%-%scale%-%colors%.gif | |
@echo off |
NewerOlder