This file contains hidden or 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
;; M-x package-install deferred | |
(require 'deferred) | |
;; | |
;; 制限時間内(LIMIT) に生成した乱数が THRESHOLD を越えれば "success!", | |
;; タイムアウトした場合は "timeout..." と表示されます。 | |
;; | |
;; 乱数生成の間隔は INTERVAL です。 | |
;; |
This file contains hidden or 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
;; -*- coding: utf-8; lexical-binding: t -*- | |
;; | |
;; Usage: | |
;; | |
;; 1. Start streaming daemon at command line. | |
;; | |
;; $ emacs -Q --daemon=hoge -l "/path/to/simple-httpd.el" -l airplay-video-server.el | |
;; | |
;; 2. Start streaming from client emacs. | |
;; |
This file contains hidden or 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 airplay/protocol:parse-text-parameters () | |
"\ | |
Parse string in current buffer. | |
Returns the text/parameters list. | |
eg. | |
(buffer-string) | |
;; => \"duration: 83.124794\\nposition: 14.467000\\n\" |
This file contains hidden or 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
(require 'zeroconf) | |
(zeroconf-init nil) ;; search at .local | |
(dolist (s (zeroconf-list-services "_airplay._tcp")) | |
(message (format "host:%s port:%s" | |
(zeroconf-service-address s) | |
(zeroconf-service-port s)))) | |
;; => host:xxxx::xxxx:xxxx:xxxx:xxxx port:80 | |
;; => host:xxx.xxx.xxx.xxx port:80 |
This file contains hidden or 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
(require 'dns) | |
(with-temp-buffer | |
(let ((process (make-network-process :name "mdns" | |
:coding 'binary | |
:buffer (current-buffer) | |
:host "224.0.0.251" | |
:service 5353 | |
:type 'datagram)) | |
(send-text (dns-write |
This file contains hidden or 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
;; ~/*.org に対して ORGMODE-Markdown を適用していく | |
(let ((exporter (assoc "Markdown" org-generic-alist)) | |
bufname) | |
(if nil (error "ORGMODE-Markdown is not loaded.") | |
(flet ((read-char-exclusive () (plist-get (cdr exporter) :key-binding))) | |
(dolist (orgfile (directory-files "~" t "\\.org$")) | |
(setq bufname (find-file-noselect orgfile)) | |
(with-current-buffer bufname | |
(org-export-generic nil)) | |
(kill-buffer bufname))))) |
This file contains hidden or 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
class String | |
# | |
# Convert ISBN-10 to ISBN-13 | |
# | |
# http://www.infonet.co.jp/ueyama/ip/glossary/isbn.html | |
# http://en.wikipedia.org/wiki/Check_digit#ISBN_13 | |
# | |
# @return [String] String as ISBN-13 format | |
# | |
def toISBN13 |
This file contains hidden or 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
--- mu4e-mark.el.orig 2012-12-05 16:29:48.410403140 +0900 | |
+++ mu4e-mark.el 2012-12-05 16:31:16.450407255 +0900 | |
@@ -189,6 +189,8 @@ | |
(let ((cant-go-further) (eor (region-end))) | |
(goto-char (region-beginning)) | |
(while (and (<= (point) eor) (not cant-go-further)) | |
+ (when (eq mark 'refile) | |
+ (setq target (mu4e~mark-get-target mark target))) | |
(mu4e-mark-at-point mark target) | |
(setq cant-go-further (not (mu4e-headers-next)))))))) |
This file contains hidden or 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
Ring ring = new Ring(); | |
ring.setOnMusclePoseDetected(new EventHandler<MusleEvent>() { | |
@Override | |
protected void handler(MuscleEvent event) { | |
switch(event.pose) { | |
case: NEXT: | |
next(); | |
break; | |
case: PREV; | |
prev(); |
This file contains hidden or 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
/* | |
* speakerdeck.com.js | |
* | |
* OpenPNE の日記に Speakerdeck の Embed を貼り付けて表示する | |
* | |
* @auther Kazuma | |
* @version 0.01 | |
* | |
*/ | |
function url2cmd(url) { |