Skip to content

Instantly share code, notes, and snippets.

View sachac's full-sized avatar

Sacha Chua sachac

View GitHub Profile
@sachac
sachac / plover.diff
Created May 2, 2021 00:08
Allow {PLOVER:ALWAYS:START}Stuff goes here{PLOVER:ALWAYS:END} dictionary entries.
--- /tmp/h6IFbe_engine.py 2021-05-01 20:07:49.946440192 -0400
+++ plover/engine.py 2021-05-01 20:07:21.054396634 -0400
@@ -95,6 +95,7 @@
def __init__(self, config, keyboard_emulation):
self._config = config
self._is_running = False
+ self._previous_state = self._is_running
self._queue = Queue()
self._lock = threading.RLock()
self._machine = None
@sachac
sachac / clock.html
Created November 6, 2018 06:29
Simple analog clock for A-
<html>
<head>
<!-- Based on https://bl.ocks.org/vasturiano/118e167e9bc93356221f67905c87cd6f , Vasco Asturiano, MIT License -->
<script src="http://cdnjs.cloudflare.com/ajax/libs/d3/4.6.0/d3.min.js"></script>
<script src="http://unpkg.com/d3-radial-axis@1.5/dist/d3-radial-axis.min.js"></script>
<style type="text/css">
body {
text-align: center;
font-family: Sans-serif;
margin: 0;
@sachac
sachac / cooking.org
Created May 2, 2017 04:46
Org Mode cooking notes, with some code for compiling a grocery list and comparing it with staples

Meal planning tool

{ p_record_id: [ '1000004', '1000004', '1000004' ],
p_date_general: [ '2001' ],
p_num_isbn: [ '0908307942' ],
p_title_short: [ 'The historical dimensions of democracy and human rights in Zimbabwe' ],
p_publication_results: [ 'Mount Pleasant, Harare, Zimbabwe : Zimbabwe University Publications, 2001-.' ],
p_publication_full: [ 'Mount Pleasant, Harare, Zimbabwe : Zimbabwe University Publications, 2001-.' ],
p_publication: [ 'Zimbabwe University Publications, 2001-.' ],
p_description_results: [ 'v. <1 > ;' ],
p_description_full: [ 'v. <1 > ; 21 cm.' ],
p_notes_contents: [ 'v.1. Pre-colonial and colonial legacies' ],

Save package symbols:

(with-temp-file "~/.emacs.d/.package-list"
  (prin1 (mapcar 'car package-archive-contents) (current-buffer))
  nil)

Compare package symbols:

| Notes | Start | End | Duration |
|--------------------------------------------------------+------------+------------+-----------|
| Emacs configuration | 4:02:25.37 | 4:27:09.30 | 00:24:44 |
| Hearing from Emacs Beginners | 4:27:27 | 5:01:00 | 00:33:33 |
| Lightning talk: Emacs Club | 5:03:19.30 | 5:19:37.83 | 00:16:18 |
| Starting an Emacs Meetup - Harry Schwartz | 5:31:52.03 | | -05:31:52 |
| Starting an Emacs Meetup - Harry Schwartz | 0:0:00 | 0:20:04 | 00:20:04 |
| Literate Devops - Howard Abrams | 1:28:20 | 2:08:15 | 00:39:55 |
| Lightning talk: Wanderlust and other mail clients | 2:15:04 | 2:26:55 | 00:11:51 |
| Making Emacs a Better Tool for Scholars - Erik Hetzner | 2:27:00 | 2:57:38 | 00:30:38 |
@sachac
sachac / flickr-upload.js
Created May 15, 2015 01:52
flickr-upload.js
/**
* Upload the file to my Flickr sketchbook and then moves it to
* Dropbox/Inbox/To blog. Save the Org Mode links in the clipboard. -
* means the photo already existed, + means it was uploaded.
*/
var async = require('async');
var cp = require('child_process');
var fs = require('fs');
var glob = require('glob');
(ert-deftest sacha/org-capture-prefill-template ()
(should
;; It should fill things in one field at a time
(string=
(sacha/org-capture-prefill-template
"* TODO %^{Task}\nSCHEDULED: %^t\n:PROPERTIES:\n:Effort: %^{effort|1:00|0:05|0:15|0:30|2:00|4:00}\n:END:\n%?\n"
"Hello World")
"* TODO Hello World\nSCHEDULED: %^t\n:PROPERTIES:\n:Effort: %^{effort|1:00|0:05|0:15|0:30|2:00|4:00}\n:END:\n%?\n"
))
(should
/**
* Adds "Blogged" links to Flickr for images that don't yet have "Blogged" in their description.
* Command-line argument: URL to retrieve and parse
*/
var secret = require('./secret');
var flickrOptions = secret.flickrOptions;
var Flickr = require("flickrapi");
var fs = require('fs');
var request = require('request');
* Inbox of sketches to classify or write about
- Learning
- [[https://www.flickr.com/photos/sachac/16180954156/][2015.01.04 Rhythm for learning -- index card]]
- [[https://www.flickr.com/photos/sachac/16052554957/][2015.01.08 Learning as an event -- index card]]
- [[https://www.flickr.com/photos/sachac/16052554877/][2015.01.09 Cross-pollination of ideas -- index card]]
- [[https://www.flickr.com/photos/sachac/16077216200/][2015.01.12 How I stopped looking for answers -- index card #reading]]
- [[https://www.flickr.com/photos/sachac/16077215930/][2015.01.12 What am I learning about -- index card #plans]]
- Emacs
- [[https://www.flickr.com/photos/sachac/16206810125/][2015.01.03 Why Emacs -- index card]]