Skip to content

Instantly share code, notes, and snippets.

@BooDoo
BooDoo / add_lensmodel.ps1
Last active August 11, 2022 20:35
Migrating lens data to LENS MODEL field where Flickr wants it
$dcim_dir = "X:\Pictures\dcim\rt"
if ($args[0]) {
# Passed paths? Act on those.
$files = foreach ($file in $args) {
Get-ChildItem -Path $file
}
}
else {
@BooDoo
BooDoo / webp2gif.zsh
Last active June 23, 2020 02:34
Animated WEBP into GIF using libwebp and ImageMagick
#!/usr/bin/zsh
rp=${1:a}
wd=${rp:a:h}
f=${rp:t}
pfx=${f:r}
outfile=$pfx.gif
#dump out all the frames using libwebp/examples/anim_dump
anim_dump -folder $wd -prefix ${pfx}_ $f
@BooDoo
BooDoo / credentials.json
Last active August 29, 2015 14:21
Tweet random image from directory, random line of text from file
{
"consumer_key": "",
"consumer_secret": "",
"access_token": "",
"access_token_secret": ""
}
@BooDoo
BooDoo / cavebot.js
Last active August 29, 2015 14:21
Node script to tweet out random image from directory, with one of an array of status text possibilities
#!/usr/bin/env node
var fs = require("fs");
var path = require("path");
var Twit = require("twit");
var credentials = readCredentials();
var twitter = new Twit(credentials);
var CAVESPATH = process.env["CAVESPATH"]; // e.g. "/home/ian/caves"
// UTILITY: Get "random" element from array:
@BooDoo
BooDoo / glitchstr.py
Last active August 29, 2015 14:14 — forked from aparrish/glitchstr.py
import random
def char_error(s):
t = ""
for ch in s:
if random.randrange(6) == 0:
t += chr(ord(ch)+random.choice([-1,1]))
else:
t += ch
return t
@BooDoo
BooDoo / pagination.css
Last active August 29, 2015 14:06
First pass: pagination in mustache
/* Builds on bootstrap */
/* Numbering page listing, since our templating is logicless */
ol.pagination {
counter-reset: page-number
}
ol.pagination > li > a.page-link::before {
counter-increment: page-number;
content: counter(page-number);
}