This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; fixed base64-decode-region that works with any number of characters (not just modulo 4) | |
(defun base64-decode () | |
(interactive) | |
(when mark-active | |
(let* ((first (region-beginning)) | |
(last (region-end)) | |
(s (buffer-substring first last)) | |
(slen (length s)) | |
(srem (% slen 4)) | |
(adjust (if (zerop srem) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; fixed base64-decode-region that works with any number of characters (not just modulo 4) | |
(defun base64-decode () | |
(interactive) | |
(when mark-active | |
(let* ((first (region-beginning)) | |
(last (region-end)) | |
(s (buffer-substring first last)) | |
(slen (length s)) | |
(srem (% slen 4)) | |
(adjust (if (zerop srem) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<!-- see https://www.brool.com/post/quick-and-dirty-shared-custom-maps/ for explanation --> | |
<head> | |
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.3.4/dist/leaflet.css" | |
integrity="sha512-puBpdR0798OZvTTbP4A8Ix/l+A4dHDD0DGqYW6RQ+9jxkRFclaxxQb/SJAWZfWAkuyeQUytO7+7N4QKrDh+drA==" | |
crossorigin=""/> | |
<script src="https://unpkg.com/leaflet@1.3.4/dist/leaflet.js" | |
integrity="sha512-nMMmRyTVoLYqjP9hrbed9S+FzjZHW5gY1TWCHA5ckwXZBadntCNs8kEqAWdrb9O7rxbCaA4lKTIWjDXZxflOcA==" | |
crossorigin=""></script> | |
<script |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
title: $:/config/tiddlyweb/host | |
$protocol$//$host$/tw/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Credits to fuckbecauseican5 from https://www.reddit.com/r/hackintosh/comments/4s561a/macos_sierra_16a238m_install_success_and_guide/ | |
# Adapted to work with the official image available into Mac App Store | |
# | |
# Enjoy! | |
hdiutil attach /Applications/Install\ macOS\ Sierra.app/Contents/SharedSupport/InstallESD.dmg -noverify -nobrowse -mountpoint /Volumes/install_app | |
hdiutil create -o /tmp/Sierra.cdr -size 7316m -layout SPUD -fs HFS+J | |
hdiutil attach /tmp/Sierra.cdr.dmg -noverify -nobrowse -mountpoint /Volumes/install_build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import datetime | |
import time | |
import urllib | |
import sys | |
origin = "1234 Main Street, Anywhere CA 12345" | |
dest = "4567 Corporation Way, Anywhere CA 12345" | |
key = "your-api-key-for-distance-matrix" | |
time_spans = range(0, 61, 15) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun count-and-submit () | |
(interactive) | |
(let* ((user-name "username") | |
(secret-key "secret-key") | |
(word-count (number-to-string (count-words (point-min) (point-max)))) | |
(hash (secure-hash 'sha1 (concat secret-key user-name word-count))) | |
(url-request-method "PUT") | |
(url-request-extra-headers `(("Content-Type" . "application/x-www-form-urlencoded"))) | |
(url-request-data (concat "hash=" hash "&name=" user-name "&wordcount=" word-count))) | |
(url-retrieve-synchronously "http://nanowrimo.org/api/wordcount") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns logic-puzzle-demo.core | |
(:require [clojure.math.combinatorics :as combo])) | |
;; Playing around with some stuff to make logic puzzles easier | |
;; Inspired by http://blog.jenkster.com/2013/02/solving-logic-puzzles-with-clojures-corelogic.html | |
;; but then really http://programming-puzzler.blogspot.com/2013/03/logic-programming-is-overrated.html | |
;; Also see http://rosettacode.org/wiki/Zebra_puzzle | |
;; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Keybase proof | |
I hereby claim: | |
* I am brool on github. | |
* I am brool (https://keybase.io/brool) on keybase. | |
* I have a public key whose fingerprint is 8ECC A073 45FF 36F2 DAD2 DD7E B8E7 2F6A C8D7 DE49 | |
To claim this, I am signing this object: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# Look! It's Statementless Python | |
# Copyright Peter Corbett 2005 | |
# NO WARRANTY: If you use this for anything important, you're mad! | |
# Credits to: Ian Jackson for having the idea, Ken Slonneger for | |
# "Syntax and Semantics of Programming Languages" (large parts this program | |
# were hand-translated from one of the examples), and fanf, with whom I | |
# cannot hope to compete. | |
# Unlike most Python programs, whitespace matters little here. It could | |
# be a one-liner if you had a monitor long enough. |
NewerOlder