Skip to content

Instantly share code, notes, and snippets.

View mttjhn's full-sized avatar

Matthew Johnson mttjhn

View GitHub Profile
@bespokoid
bespokoid / SpaceVim.md
Last active May 20, 2024 23:27
SpaceVim cheatsheet #tools
@shaunkane
shaunkane / bear-backup.py
Created January 9, 2017 17:38
Script for automating Bear note backups. Note that you must fill in the BEAR_DB and EXPORT_DIR variables for this to work.
# export notes from the Bear db to markdown files
import sqlite3
BEAR_DB = '/Users/<your username>/Library/Containers/net.shinyfrog.bear/Data/Library/Application Support/net.shinyfrog.bear/database.sqlite'
EXPORT_DIR = '<set an export directory>'
conn = sqlite3.connect(BEAR_DB)
c = conn.cursor()
for row in c.execute('SELECT ZTITLE, ZTEXT FROM ZSFNOTE'):
@ttscoff
ttscoff / dontforget.bash
Last active November 8, 2023 06:42
Quick reminders from Terminal (bash)
#!/bin/bash
# dontforget
#
# A stupid script for short term reminders in bash
#
# Arguments just need to contain a number and a bunch of words.
#
# The number can be anywhere in the arguments, but there shouldn't
# be any other numeric digits.
#
@lelandbatey
lelandbatey / whiteboardCleaner.md
Last active June 2, 2024 11:23
Whiteboard Picture Cleaner - Shell one-liner/script to clean up and beautify photos of whiteboards!

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"

Results

@phpmaps
phpmaps / gist:5249656
Created March 26, 2013 21:53
ArcGIS JSAPI setRequestPreCallback
esri.setRequestPreCallback(updateAddressParameters); //goes in init()
function updateAddressParameters(ioArgs) {
if ( ioArgs.url.indexOf("findAddressCandidates") != -1) {
ioArgs.content["Single Line Input"] = "201 s jackson st, Seattle, 98104";
}
return ioArgs; }
@erikh
erikh / hack.sh
Created March 31, 2012 07:02 — forked from DAddYE/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#