Skip to content

Instantly share code, notes, and snippets.

View tomsoderlund's full-sized avatar
🤔
Learning AI/ML!

Tom Söderlund tomsoderlund

🤔
Learning AI/ML!
View GitHub Profile
@tomsoderlund
tomsoderlund / convert_evernote_html_to_markdown.sh
Last active June 3, 2017 04:24
Convert Evernote notes in HTML to Markdown
#!/usr/bin/env
# Convert Evernote notes in HTML to Markdown
# requires reverse_markdown (https://github.com/xijo/reverse_markdown)
# Preserve timestamp from Evernote
function get_timestamp {
reverse_markdown "$1" | \
sed -n '/<meta name="created" content="/p' | \
sed -e 's/<meta name="created" content="//g' | \
@tomsoderlund
tomsoderlund / superwatcher-jquery.js
Last active February 19, 2017 08:54
SuperWatcher in JavaScript: watches a function/value, triggers a callback when changed
// ----- SuperWatcher JQuery extension -----
var watcher = new SuperWatcher();
// Dynamically modify a CSS property when function result changes
$.fn.dynamicCss = function (prop, func) {
// Currying the $.css method
watcher.add(func.bind(this), this.css.bind(this, prop), prop);
// For function chaining
return this;