Skip to content

Instantly share code, notes, and snippets.

@jasonsnell
jasonsnell / weatherkit-sampleproject.py
Last active June 25, 2024 00:07
WeatherKit API sample
#! /usr/bin/env python3
import time
import jwt
import json
import requests
from datetime import datetime
from collections import defaultdict
import matplotlib.pyplot as plt
@huytd
huytd / wordle.md
Last active May 16, 2024 20:39
Wordle in less than 50 lines of Bash

image

How to use:

./wordle.sh

Or try the unlimit mode:

@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>
@ttscoff
ttscoff / TP3 Numeric Tag Cycle.js
Created February 20, 2018 18:22
Keyboard Maestro macro for cycling numeric tag values in TaskPaper 3
// Cycle forward/back through numeric tags
// Brett Terpstra <http://brettterpstra.com>
// Credit: Rob Trew @complexpoint
(function () {
'use strict';
function TaskPaperContext(editor, options) {
var selection = editor.selection,
@ttscoff
ttscoff / TP3 Date From Natural Language.js
Created February 20, 2018 18:16
Keyboard Maestro macro for natural language dates in TaskPaper 3
(function() {
'use strict'
function TPContextExpandDates(editor, options) {
function toRx(string) {
return '(' + string.split(/[ ,]+/).join('|') + ')';
@steven2358
steven2358 / ffmpeg.md
Last active June 23, 2024 18:17
FFmpeg cheat sheet
@pkuczynski
pkuczynski / status.sh
Created October 16, 2017 14:33
Kubectl get pods with colorful output
kubectl get pods --all-namespaces \
| awk -v GREEN='\033[01;32m' \
-v NORMAL='\033[0m' \
-v YELLOW='\033[01;33m' \
-v RED='\033[01;31m' \
--field-separator='\s' '{
if (NR > 1) {
for (n=1; n<NF; n++) {
if (n == 3) {
split($n, ready, "/")
@ttscoff
ttscoff / appinfo.md
Last active June 11, 2024 18:07
appinfo: A quick ruby script for Mac that returns some information for a specified Mac app in Terminal. Includes icon display if using imgcat or chafa are available.

appinfo

A script for getting details of installed Mac apps. Like Get Info but faster and cooler.

Save the script below as appinfo somewhere in your path. Make it executable with chmod a+x appinfo. Then just run appinfo APPNAME to get info on any installed app.

@ttscoff
ttscoff / init.lua
Last active January 9, 2024 23:44
Hammerspoon config examples for hyper key
-- A global variable for the Hyper Mode
k = hs.hotkey.modal.new({}, "F17")
-- Trigger existing hyper key shortcuts
k:bind({}, 'm', nil, function() hs.eventtap.keyStroke({"cmd","alt","shift","ctrl"}, 'm') end)
-- OR build your own
launch = function(appname)
@ttscoff
ttscoff / csv-to-mmd-tables.rb
Last active December 1, 2017 02:18
A messy script for converting simple CSV syntax to MultiMarkdown tables, for use in the Markdown Service Tools <http://brettterpstra.com/projects/markdown-service-tools/>
#!/usr/bin/env ruby
require 'csv'
# md - Tables - Create from CSV
# v1.1 2016-08-17
# From the Markdown Service Tools <http://brettterpstra.com/projects/markdown-service-tools/>
# Converts CSV style input to MultiMarkdown tables
# Changelog
# 1.1: Fixed error when line ended with whitespace in middle of input