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 | |
import datetime, json, sys | |
def formatEntry(entry): | |
return "%s (%s) (%s)" % (entry['title'].encode('utf8') | |
if entry.has_key('title') else "<untitled>", | |
entry['url'].encode('utf8'), | |
datetime.datetime.fromtimestamp( | |
int(tab['lastAccessed']) / 1000).strftime('%Y-%m-%d %H:%M:%S')) |
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 ruby | |
# encoding: utf-8 | |
# first part, get temperature | |
temp_str = `aticonfig --adapter=0 --od-gettemperature` | |
temp = temp_str.scan(/Sensor 0: Temperature - (\d+\.\d+) C/)[0][0].to_i | |
# determine fan speed | |
thresholds = [ 40, 60, 70, 80, 85 ] | |
speeds = [ 10, 25, 30, 35, 50 ] |
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 org-agenda-subtree-or-region (prefix) | |
"Display an agenda view for the current subtree or region. | |
With prefix, display only TODO-keyword items." | |
(interactive "p") | |
(let (header) | |
(if (use-region-p) | |
(progn | |
(setq header "Region") | |
(put 'org-agenda-files 'org-restrict (list (buffer-file-name (current-buffer)))) | |
(setq org-agenda-restrict (current-buffer)) |
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
// createshortcut.js -- ++pentadactyl | |
// @Author: eric.zou (frederick.zou@gmail.com) | |
// @License: GPL (see http://www.gnu.org/licenses/gpl.txt) | |
// @Created: Tue 29 Nov 2011 01:24:05 PM CST | |
// @Last Change: Tue 29 Nov 2011 02:23:36 PM CST | |
// @Revision: 41 | |
// @Description: | |
// @Usage: | |
// @TODO: | |
// @CHANGES: |
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
*.enex |
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 my/python-mode-outline-hook () | |
(setq outline-level 'my/python-outline-level) | |
(setq outline-regexp | |
(rx (or | |
;; Commented outline heading | |
(group | |
(* space) ; 0 or more spaces | |
(one-or-more (syntax comment-start)) | |
(one-or-more space) |
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 ap/org-return (&optional ignore) | |
"Add new list item, heading or table row with RET. | |
A double return on an empty element deletes it. Use a prefix arg | |
to get regular RET. " | |
;; See https://gist.github.com/alphapapa/61c1015f7d1f0d446bc7fd652b7ec4fe and | |
;; http://kitchingroup.cheme.cmu.edu/blog/2017/04/09/A-better-return-in-org-mode/ | |
(interactive "P") | |
(if ignore | |
(org-return) | |
(cond ((eq 'link (car (org-element-context))) |
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 ap/org-avy-refile-as-child () | |
"Refile current heading as first child of heading selected with `avy.'" | |
;; Inspired by `org-teleport': http://kitchingroup.cheme.cmu.edu/blog/2016/03/18/Org-teleport-headlines/ | |
(interactive) | |
(let* ((org-reverse-note-order t) | |
(pos (save-excursion | |
(avy-with avy-goto-line (avy--generic-jump (rx bol "*") nil avy-style)) | |
(point))) | |
(filename (buffer-file-name (or (buffer-base-buffer (current-buffer)) | |
(current-buffer)))) |
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
;;; Neat convenience function for working with Elisp's EIEIO objects | |
(defmacro oref* (object &rest slots) | |
"Like `oref', but each slot in SLOTS is applied in sequence. | |
For example, | |
\(oref* obj :inner :property) | |
is equivalent to |
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
(defmacro -$ (&rest body) | |
(cl-labels ((collect-vars | |
(&rest forms) | |
(cl-loop for form in forms | |
append (cl-loop for atom in form | |
if (and (symbolp atom) | |
(string-match (rx bos "$") | |
(symbol-name atom))) | |
collect atom | |
else if (consp form) |
OlderNewer