Skip to content

Instantly share code, notes, and snippets.

View QuaCKeReD's full-sized avatar

Mark Kelly-Smith QuaCKeReD

View GitHub Profile
@QuaCKeReD
QuaCKeReD / new note.md
Last active June 12, 2022 18:46
Templater based workflow for creating new notes - Reason: I was fed up of having to select 5 different combinations of metadata, some combinations of which were not valid

<%* tpOptionsList = await tp.file.include('[[noteYamlOptions]]') || '' tpOptions = tpOptionsList.split('\n') || ''

tpOptionChosen = await tp.system.suggester(tpOptions, tpOptions, false, "Select option") || ''

tpOptionChosenArea = tpOptionChosen.toString().split(',')[0] || '' tpOptionChosenCompany = tpOptionChosen.toString().split(',')[1] || '' tpOptionChosenClient = tpOptionChosen.toString().split(',')[2] || '' tpOptionChosenProject = tpOptionChosen.toString().split(',')[3] || ''

@kepano
kepano / obsidian-web-clipper.js
Last active April 29, 2024 18:24
Obsidian Web Clipper Bookmarklet to save articles and pages from the web (for Safari, Chrome, Firefox, and mobile browsers)
javascript: Promise.all([import('https://unpkg.com/turndown@6.0.0?module'), import('https://unpkg.com/@tehshrike/readability@0.2.0'), ]).then(async ([{
default: Turndown
}, {
default: Readability
}]) => {
/* Optional vault name */
const vault = "";
/* Optional folder name such as "Clippings/" */
@samuelkordik
samuelkordik / readinglist_pinboard.py
Last active February 16, 2023 07:23
Sync Safari Reading List bookmarks to Pinboard
#!/Users/samuelkordik/.pyenv/shims/python
# ReadingListCatcher
# - A script for exporting Safari Reading List items to Markdown and Pinboard
# Originally by Brett Terpstra 2015, <https://brettterpstra.com/2015/01/06/reading-list-catcher/>
# Modifications by Zach Fine made in 2020 to use the original reading list item in the
# posts to pinboard.
# Updated 2021-06-21 by Samuel Kordik to fix errors due to deprecated API in plistlib,
# changes to Pinboard api and Pinboard python lib; added enhanced logging output
# and error handling to work as a cron job or shell script.
# Uses code from <https://gist.github.com/robmathers/5995026>
@olih
olih / jq-cheetsheet.md
Last active April 20, 2024 06:34
jq Cheet Sheet

Processing JSON using jq

jq is useful to slice, filter, map and transform structured json data.

Installing jq

On Mac OS

brew install jq

@m-wild
m-wild / cloudflaredns.sh
Last active June 1, 2022 20:18 — forked from briped/gratisdns.sh
CloudFlare dynamic dns updater module for Synology
#!/bin/sh
# cloudflareddns.sh - dynamic dns updater module for Synology
#
# Author:
# Michael Wildman (http://mwild.me)
#
# Version:
# 0.2
#
@tehpeh
tehpeh / ddclient-cloudflare-macosx.md
Last active August 6, 2023 14:16
Dynamic DNS for Mac OS X with CloudFlare and ddclient

Update June 2019

The patch described below may no longer be necessary. CloudFlare instructions here. Perl module JSON::Any may still be required, however, see comments.

Description

Dyn's free dynamic DNS service will be ending on Wednesday, May 7th, 2014.

CloudFlare, however, has a little known feature that will allow you to update your DNS records via API or a command line script called ddclient. This will

@evanscottgray
evanscottgray / docker_kill.sh
Last active November 7, 2023 03:40
kill all docker containers at once...
docker ps | awk {' print $1 '} | tail -n+2 > tmp.txt; for line in $(cat tmp.txt); do docker kill $line; done; rm tmp.txt
@nicolasH
nicolasH / FlickrSnippets.py
Created March 30, 2013 07:50
FlickrSnippets
# Get the sharing / embed snippets from
# the non-mobile flickr page of an image.
# (if sharing is not restricted on that image).
#
# Usage:
# 1. Copy the flickr photo mobile url to the clipboard
# 2. Run this script
# 3. Copy the snippet you want!
#
# A couple of lines come from get_links.py
@endolith
endolith / export_google_starred_locations.py
Created October 16, 2012 02:29
Export Google Maps starred locations
# -*- coding: utf-8 -*-
"""
Go to Google Bookmarks: https://www.google.com/bookmarks/
On the bottom left, click "Export bookmarks": https://www.google.com/bookmarks/bookmarks.html?hl=en
After downloading the html file, run this script on it to generate a KML.
"""
@ryanblock
ryanblock / @ryan tweetbot regex.md
Created August 29, 2012 02:27
How Tweetbot and regex made my Twitter replies usable again (filed under: #wrongryan)

How Tweetbot and regex made my Twitter replies usable again

As it turns out, most normal humans are incapable of learning to use Twitter @ replies. And in case you don't follow me on Twitter: yes, my handle (@ryan) gets a lot of erroneous mentions. (The most amusing, random ones I've even taken to retweeting under the #wrongryan hashtag.)

Then Tweetbot -- and its ability to use regex as Twitter filters -- came along. Here's how the Tapbots guys and some regular expressions single-handedly made my Twitter replies usable again.

Notes and caveats

  • I'm not a regex expert. Far from it. I suck at regex, actually. If you have suggestions for improvements, please leave them below!
  • Some regex may look a little sloppy, but in actuality was written because TweetBot for Mac's regex filter support is very early, and things like repeats (expression{3,}) are buggy. So everything below should work without crashing Tweetbot for iPhone, iPad, and Mac.
  • Obvious, but not everyone should make use of every filter b