Skip to content

Instantly share code, notes, and snippets.

View sashka's full-sized avatar
🧭
Exploring Zig

sashka

🧭
Exploring Zig
View GitHub Profile
@sashka
sashka / mac-keycodes
Created March 14, 2024 18:17 — forked from eegrok/mac-keycodes
Mac virtual keycodes
from: http://www.meandmark.com/keycodes.html
Virtual Keycodes for the Mac QWERTY Layout
Keycodes are in hexadecimal. A blank entry means either there is no key assigned to that keycode or I was unable to find the assigned key.
Keycode Key
0x00 A
0x01 S
0x02 D
0x03 F

Business Models

Advertising

Models Examples
Display ads Yahoo!
Search ads Google

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert $1 -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 $2

Results

#!/bin/bash
f=$(pwd)
sips --resampleWidth 512 "${f}/${1}" --out "${f}/iTunesArtwork"
sips --resampleWidth 1024 "${f}/${1}" --out "${f}/iTunesArtwork@2x"
sips --resampleWidth 57 "${f}/${1}" --out "${f}/Icon.png"
sips --resampleWidth 114 "${f}/${1}" --out "${f}/Icon@2x.png"
sips --resampleWidth 29 "${f}/${1}" --out "${f}/Icon-Small.png"
sips --resampleWidth 58 "${f}/${1}" --out "${f}/Icon-Small@2x.png"
sips --resampleWidth 50 "${f}/${1}" --out "${f}/Icon-Small-50.png"
#!/usr/bin/env python
import argparse
import logging
import os
import re
import subprocess
from itertools import islice