Skip to content

Instantly share code, notes, and snippets.

@mftrhu
mftrhu / ddg.sh
Created December 24, 2017 22:10
ddg.sh - Search the internet with DuckDuckGo from your terminal
#!/bin/sh
# ddg.sh - Search the internet with DuckDuckGo from your terminal
# Made with boredom, on Christmas Eve, by mftrhu
# Requirements:
# awk, curl OR wget, sed, head, tail, grep, tput (MAYBE)
available () {
command -v "$1" >/dev/null 2>&1
}
@josephg
josephg / 0dedict.py
Last active February 16, 2024 08:33
Apple dictionaries
# Thanks to commenters for providing the base of this much nicer implementation!
# Save and run with $ python 0dedict.py
# You may need to hunt down the dictionary files yourself and change the awful path string below.
# This works for me on MacOS 10.14 Mohave
from struct import unpack
from zlib import decompress
import re
filename = '/System/Library/Assets/com_apple_MobileAsset_DictionaryServices_dictionaryOSX/9f5862030e8f00af171924ebbc23ebfd6e91af78.asset/AssetData/Oxford Dictionary of English.dictionary/Contents/Resources/Body.data'
f = open(filename, 'rb')