Skip to content

Instantly share code, notes, and snippets.

@Zettt
Zettt / expandurl.sh
Created June 12, 2014 09:02
Expand short URL from clipboard. Works with Keyboard Maestro, TextExpander, Alfred, LaunchBar, you name it.
curl -sIL `pbpaste` | grep ^[lL]ocation | cut -c 11- | pbcopy
# 1. Download the top 100 from CoinMarketCap.
# 2. Download all USDT-based pairs from Binance.
# 3. Print out a list of the top 100 coins tradeable on Binance.
#
# The theory is that the top coins are going to perform best
# in a bull market. With this information we can build a momentum
# strategy based on the top coins only.
# Suggestion usually is to check the top 100 coins monthly,
# then rebalance the portfolio.
@Zettt
Zettt / packagizer.sh
Last active December 13, 2023 02:47
TextBundle Packagizer -- This is a script that helps to create bundled folders of Markdown files. It downloads online-linked images to an assets directory, as well as copies local files to it. It's not finished yet.
#!/bin/sh
function usage {
echo "This script creates a folder containing all linked ![images]()"
echo "of a Markdown file -- even linked ones from the Internet."
echo ""
echo "It takes one argument: the file it should process."
echo
echo "When a file argument is present, it creates a new folder for:"
echo "a) the Markdown file"
@Zettt
Zettt / Move Mail Message Multiple Accounts.applescript
Last active December 8, 2023 23:16
AppleScript to move selected Mail messages to a particular mailbox of a particular account. User is asked only once. [This script](https://gist.github.com/Zettt/6551617) let's you choose an account first.
(*
Mail Filer
Files messages in Mail.app using type ahead. Displays one dialog containing all mailboxes and accounts.
Created by Andreas Zeitler on 2013-09-13
Copyright Mac OS X Screencasts 2013. All rights reserved.
*)
set myMailboxes to {}
@Zettt
Zettt / Add to Reading List.applescript
Created October 7, 2012 14:37
Add links from Mail to Safari Reading List
(*
Add to Reading List
Script for Apple Mail to find http and https links in emails and add them to Safari's Reading List automatically.
Best practice: setup with "any recipient contains '+reading'". Actions "mark as read", "execute AppleScript", "delete message", "stop evaluating rules"
Created by Andreas Zeitler on 2012-10-07
Mac OS X Screencasts. www.macosxscreencasts.com
*)
@Zettt
Zettt / readme.md
Last active March 11, 2023 10:11
Paste by Typing: Binance Copy/Paste (Mac only)

If you are annoyed as much as I am by Binance inability to paste clipboard values into the order boxes, you're welcome. (Please do us all a favor and file a bug report too!)

On a Mac you can simply use an AppleScript to type everything that is on the clipboard for you. The script is this:

try
	the clipboard as text
on error
	set the clipboard to " "
end try
@Zettt
Zettt / xmpScript.applescript
Created December 9, 2011 14:08
Use xmp to convert DMF files to WAV
set channelNumbers to 12
set fileName to "/Users/you/Projects/SONGNAME"
set nr to 1
set extension to ".WAV"
set dmfFileName to "'/Users/you/Projects/SONGNAME.DMF'"
repeat while nr ≤ channelNumbers
-- display dialog nr
@Zettt
Zettt / ssh.sh
Created August 10, 2014 18:03
Some SSH Tricks
Copy your ssh public key to a server from a machine that doesn’t have ssh-copy-id
#/bin/bash
if [ -z "$2" ]
then
echo "Usage: $0 id_file hostname|ssh-nickname"
else
cat "$1" |ssh $2 'sh -c "cat - >>~/.ssh/authorized_keys"'
fi
@Zettt
Zettt / TextExpander to Text Shortcuts.applescript
Last active September 17, 2022 02:12
TextExpander Snippet to iOS/OS X Text Shortcuts. Read more: http://tmblr.co/ZFavEy-uZJ-M
set clickDelay to 0.3
set abbreviationList to {}
set snippetsList to {}
set disallowedGroups to {"AutoCorrect", "AutoCorrect Deutsch Snippets", "AlteNeue Rechtschreibung", "Deutsche Akronyme"}
set disallowedSnippetContents to {"%e", "%d", "%a", "%A", "%m", "%1m", "%b", "%B", "%y", "%Y", "%H", "%I", "%1H", "%1I", "%M", "%1M", "%S", "%1S", "%p", "%@+", "%@-", "%key:", "%clipboard", "%|", "%<", "%^", "%>", "%v", "%-", "%+", "%fill:", "%fillpart:", "%filltext:", "%fillpopup:", "%fillarea:"}
-- open the Text tab of Keyboard preferences
tell application "System Preferences"
activate
delay 5
@Zettt
Zettt / OpenMeta2OSXTags.sh
Last active May 5, 2021 15:58
Script that reads OpenMeta tags and writes them to OS X Mavericks tags. http://mosx.tumblr.com/post/54049528297/convert-openmeta-to-os-x-mavericks-tags-with-this This requires a OpenMeta binary to be installed. Change its path, if you prefer it to be somewhere else. For the files to be processed properly don't include a trailing slash in `$files…
# =============================================================
# = OpenMeta to OS X Tags =
# =============================================================
# Script to convert OpenMeta tags to OS X Mavericks tags.
#
# Created by Zettt (Andreas Zeitler) on 2013-06-28
# Source www.macosxscreencasts.com, mosx.tumblr.com
#
# OpenMeta to OS X Tags by Andreas Zeitler is licensed under a
# Creative Commons Attribution-NonCommercial-ShareAlike