This generates a public/private keypair.
$ gpg --gen-key
$ gpg --list-secret-keys
tell application "Notes" | |
set note_body_list to (get body of every note) | |
end tell | |
set note_count to (count of note_body_list) | |
set blah_folder to choose folder | |
set blah_path to POSIX path of blah_folder | |
repeat with i from 1 to note_count | |
set filename_string to ((blah_path & "note" & (i as string) & ".html") as text) |
func testReservationListPositions() { | |
let moc = CoreDataStack.sharedStack().mainObjectContext | |
let reservationListVC = ReservationListViewController() | |
do { | |
let reservation1 = try ReservationFactory.generateWithTemplate(ReservationFactory.Template(), parentContext: moc) | |
} catch { | |
print(error) | |
} | |
let cache = new Map(); | |
let pending = new Map(); | |
function fetchTextSync(url) { | |
if (cache.has(url)) { | |
return cache.get(url); | |
} | |
if (pending.has(url)) { | |
throw pending.get(url); | |
} |
// <https://stackoverflow.com/a/4673436/2100126> | |
// First, checks if it isn't implemented yet. | |
if (!String.prototype.format) { | |
String.prototype.format = function() { | |
var args = arguments; | |
return this.replace(/{(\d+)}/g, function(match, number) { | |
return typeof args[number] != 'undefined' | |
? args[number] | |
: match | |
; |
%matplotlib inline | |
import sys | |
import matplotlib.pyplot as plt | |
import numpy as np | |
import scipy.stats as st | |
from matplotlib import animation as ani | |
import sklearn.metrics as mt |
javascript:(function(){f='https://typefully.com/?new='+encodeURIComponent(document.title)+'%250A'+encodeURIComponent(window.location.href);a=function(){if(!window.open(f))location.href=f};if(/Firefox/.test(navigator.userAgent)){setTimeout(a,0)}else{a()}})() |
#!/usr/bin/python3 | |
from clang.cindex import Index, Config, CursorKind | |
import json as JsonUtil | |
import os, io, sys | |
class MyTreeWalker: | |
def __init__(self): |
// | |
// SnappyWindow.swift | |
// A NSWindow that snaps to corners | |
// | |
// Created by Alasdair Monk on 03/02/2021. | |
// | |
import Foundation | |
import Cocoa |
This is one chapter of my "Chrome Extension Workshops" tutorial, see the rest here: https://gist.github.com/caseywatts/8eec8ff974dee9f3b247
Unrelated update: my book is out! Debugging Your Brain is an applied psychology / self-help book
I'm feeling very clever. I've got this sweet line of javascript that replaces "cloud" with "butt". My mom would LOVE this, but she doesn't computer very well. I'm afraid to show her the Developer Console and have her type/paste this in. But she IS pretty good at bookmarks, she knows just how to click those!
A bookmark normally takes you to a new web page. A bookmarklet is a bookmark that runs javascript on the current page instead of taking you to a new page. To declare that it is a bookmarklet, the "location" it points to starts with javascript:
.