Skip to content

Instantly share code, notes, and snippets.

View webercoder's full-sized avatar
🌴

webercoder

🌴
  • Sydney, Australia
  • 03:42 (UTC +11:00)
View GitHub Profile
@webercoder
webercoder / mtg-resize.sh
Last active January 10, 2016 04:04
Takes MTG CCGHQ XLHQ images, strips the border, and adds a border size of your chosing. Tested with only the unglued basics.
#!/bin/bash
if [ "$#" -lt 1 ]; then
echo "Illegal number of parameters"
echo "Usage: $0 directory [border-size]"
exit
fi
if [ ! -z $2 ]; then
border=$2
else
border=65
#!/bin/bash
# Array with expressions
expressions=("guuuuuuuuuurrrrrrrrrrrr" "cluck cluck cluck" "click" "tick tock")
voices=("Karen" "Diego" "Sara" "Thomas" "Victoria")
# Seed random generator
RANDOM=$$$(date +%s)
# Get random expression...
@webercoder
webercoder / copy-iphone-photos.go
Created January 3, 2017 05:29
Recursively find iPhone photos in a directory and copy them to another
package main
import (
"fmt"
"io"
"os"
"os/exec"
"path/filepath"
"strconv"
"strings"
@webercoder
webercoder / make-number-puzzle.js
Created March 2, 2019 01:01
make-number-puzzle.js
function getRandomInt(max) {
return Math.floor(Math.random() * Math.floor(max));
}
function makePuzzle(rows = 5, columns = 5, max = 20) {
const find = getRandomInt(max);
console.log(`Find the number ${find}`);
const puzzle = [];
for (let i = 0; i < rows; i++) {
puzzle[i] = [];
@webercoder
webercoder / cookie-warning.js
Last active July 27, 2021 18:15
Simple, opt-in cookie warning template for GDPR. (Warning: may not be sufficient to meet legal requirements 🤷‍♂️)
@webercoder
webercoder / srcset-generator.sh
Last active December 30, 2020 15:39
Create several sizes of an image for use with the HTML srcset attribute.
#!/bin/bash
function usage {
cat << EOM
Usage: $0 filename size [quality, default: 75] [count, default: 3]
For example:
$0 rad.jpg 1024 75 3