Skip to content

Instantly share code, notes, and snippets.

@jikanter
jikanter / 0dedict.py
Created December 26, 2024 20:40 — forked from josephg/0dedict.py
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')
@jikanter
jikanter / 0dedict.py
Created December 26, 2024 20:40 — forked from jordankanter/0dedict.py
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')
@jikanter
jikanter / querystring-nodeps.js
Last active December 26, 2024 20:35 — forked from foriacus/querystring.js
QueryString Parsing Javascript
let parseQs = function(str){
if ('string' != typeof str) return {};
str = String.prototype.trim(str);
if ('' == str) return {};
var obj = {};
var pairs = str.split('&');
for (var i = 0; i < pairs.length; i++) {
var parts = pairs[i].split('=');
@jikanter
jikanter / lib-singlepageapp.js
Last active December 6, 2023 04:05 — forked from cougrimes/lib-singlepageapp.js
[DL Data Layer Workaround] Utag singlepageapp.js #datalayer
/* Welcome to lib-singlepageapp.js! This script is meant to handle using single-page
applications (SPAs) for Tealium when you do not have direct access to Angular, Vue,
React, etc. for making modifications. This allows us to get around limitations of
utag.view(). The trigger in this case is a global event listener that evaluates
any time there is a click. If a new URL is populated via the history API, we'll treat
that as a "pageview". Note in this case that I have defined a UDO variable of page.
This variable is then mapped to anything requiring a page URL. For example, in GA I
have this variable mapped to config.page_location so it acts like a native page URL view.*/
/*