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
REPO=whatever/youwant; curl -sSL -H "Authorization: Bearer $(curl -sSL "https://auth.docker.io/token?service=registry.docker.io&scope=repository:${REPO}:pull" | jq -r .token)" -H 'Accept: application/vnd.docker.distribution.manifest.v2+json' "https://registry-1.docker.io/v2/${REPO}/manifests/latest" | jq -r '.layers[].digest' | while read digest; do curl -sSL -H "Authorization: Bearer $(curl -sSL "https://auth.docker.io/token?service=registry.docker.io&scope=repository:${REPO}:pull" | jq -r .token)" "https://registry-1.docker.io/v2/${REPO}/blobs/${digest}" | tar -tz | sed "s/^/${digest##*:}\t/"; 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
{ | |
"manifest_version": 3, | |
"version": "1", | |
"name": "theme", | |
"description": "a theme for chrome", | |
"theme": { | |
"colors": { | |
"frame": [ 151, 210, 92 ], | |
"frame_inactive": [ 204, 233, 175 ] | |
} |
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/sh | |
cat >>/Applications/Slack.app/Contents/Resources/app.asar.unpacked/src/static/ssb-interop.js <<"EOF" | |
document.addEventListener('DOMContentLoaded', function() { | |
$(`<style>* { font-variant-ligatures: none;}</style>`).appendTo("head"); | |
}); | |
EOF |
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
curl https://upload.wikimedia.org/wikipedia/commons/3/3f/HST-SM4.jpeg | | |
convert - -alpha set -bordercolor black -border 1 -fill none -fuzz 8% -draw "color 0,0 floodfill" -shave 1x1 -trim -write hst.png \ | |
-background none -gravity center -resize 64x64 -extent 64x64 -define icon:auto-resize=64,48,32,16 favicon.ico |
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
package main | |
import ( | |
"database/sql" | |
"flag" | |
"fmt" | |
"math/rand" | |
"os" | |
"os/exec" | |
"time" |
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 | |
# html-to-pdf.sh wraps Chrome's headless PDF printing, mostly to enable WSL to use Chrome on | |
# Windows. I'm sorry. | |
WINDOWS_USER=${WINUSER:-Luke} | |
WSL_DRIVE=${WSL_DRIVE:-c} | |
WINDOWS_DRIVE=${WINDOWS_DRIVE:-C} | |
WSL_WORKSPACE=${WSL_WORKSPACE:-/mnt/${WSL_DRIVE}/Users/${WINDOWS_USER}/} | |
WINDOWS_WORKSPACE=${WINDOWS_WORKSPACE:-${WINDOWS_DRIVE}:\\Users\\${WINDOWS_USER}} | |
WINDOWS_CHROMEBIN=${WINDOWS_CHROMEBIN:-/mnt/${WSL_DRIVE}/Program Files (x86)/Google/Chrome/Application/chrome.exe} |
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
$ sqlite3 /Users/$USER/Library/Application\ Support/Dock/desktoppicture.db 'SELECT * FROM data;' | |
/Library/Desktop Pictures/x-2560px.jpg | |
0.0 | |
5.0 | |
Yosemite.jpg | |
$ sqlite3 /Users/$USER/Library/Application\ Support/Dock/desktoppicture.db 'UPDATE data SET value ="/Library/Desktop Pictures/y-2560px.jpg";' | |
$ killall Dock |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
int move( int * map, int w, int h, int d, int p [2][3] ) { | |
int x, y, z, i; | |
int moves[3][3] = { { 1, 0, 0 }, { 0, 1, 0 }, { 0, 0, 1 } }; | |
/* Move to the first available empty space that isn't a player */ | |
for( i = 0; i < 6; ++i ) { | |
int j = i > 2 ? -1 : 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
// Initially zero. When decremented to zero, fires callback | |
function semaphore( callback ) { | |
var fn = callback, | |
count = 0; | |
return { | |
increment: function() { | |
count++; | |
}, | |
decrement: function() { | |
if( count > 0 ) { |