Skip to content

Instantly share code, notes, and snippets.

View mhayashi1120's full-sized avatar

Masahiro Hayashi mhayashi1120

View GitHub Profile
@mhayashi1120
mhayashi1120 / nlet.el
Last active August 29, 2015 14:10
named-let
(defmacro nlet (name varlist &rest body)
"Named-LET for elisp. Create function dynamic bind as NAME.
DO NOT use primitive name of elisp function as NAME.
Example:
\(nlet next ((a 0)
(res '()))
(if (< a 3)
(next (1+ a) (cons (* a 2) res))
(nreverse res)))
@mhayashi1120
mhayashi1120 / exam-gosh2
Last active August 29, 2015 13:58
gosh memory exhaustion
#!/usr/bin/env /usr/local/gauche-current/bin/gosh
(debug-print-width #f)
(use gauche.uvector)
(use gauche.sequence)
(use gauche.threads)
(use rfc.json)
(use parser.peg)
@mhayashi1120
mhayashi1120 / anonymous-gist.txt
Created March 19, 2014 00:58
error log 20140319
一番最初のエラーは一週間前の gosh に関係するみたいなのですけど
Mar 12 15:39:39 zeus kernel: [204006.465570] gosh: page allocation failure: order:1, mode:0x20
Mar 12 15:39:39 zeus kernel: [204006.465578] Pid: 3135, comm: gosh Not tainted 3.2.0-4-amd64 #1 Debian 3.2.54-2
Mar 12 15:39:39 zeus kernel: [204006.465581] Call Trace:
Mar 12 15:39:39 zeus kernel: [204006.465584] <IRQ> [<ffffffff810b8f30>] ? warn_alloc_failed+0x11f/0x134
Mar 12 15:39:39 zeus kernel: [204006.465599] [<ffffffff810bbc60>] ? __alloc_pages_nodemask+0x704/0x7aa
Mar 12 15:39:39 zeus kernel: [204006.465606] [<ffffffff810eb115>] ? kmem_getpages+0x4c/0xd9
Mar 12 15:39:39 zeus kernel: [204006.465610] [<ffffffff810ec4c6>] ? fallback_alloc+0x13e/0x1e2
Mar 12 15:39:39 zeus kernel: [204006.465617] [<ffffffff8134fdc7>] ? _raw_spin_unlock_irqrestore+0xe/0xf
@mhayashi1120
mhayashi1120 / exam-gosh2
Created March 27, 2012 12:58
(logand 生 死) => 愛 by gauche
(print (ucs->char (logand (char->ucs #\生) (char->ucs #\死))))
@mhayashi1120
mhayashi1120 / cond.el
Created February 4, 2012 12:44
srfi cond
(defmacro srfi-cond (&rest clauses)
(reduce
(lambda (clause res)
(let ((test (car clause)))
(cond
((eq (cadr clause) '=>)
(unless (= (length clause) 3)
(error "Malformed `srfi-cond' test => expr"))
(let ((v (make-symbol "v")))
`(let ((,v ,test))
@mhayashi1120
mhayashi1120 / and-let.el
Last active September 30, 2015 06:28
and-let*
;; [SRFI-2]
;; http://srfi.schemers.org/srfi-2/srfi-2.html
;;
;; AND-LET* (CLAWS) BODY
(require 'cl-lib)
(defmacro and-let* (varlist &rest body)
"Like `let' but bind only if CLAW bind non-nil value.
Useful to avoid deep nest of `let' and `and'/`when'/`if' test.
@mhayashi1120
mhayashi1120 / mew-local-date.el
Created January 5, 2012 12:59
Display local date for Mew message
(defvar mew-my-message-date-overlay nil)
(defun mew-my-message-date-overlay ()
(or
mew-my-message-date-overlay
(setq mew-my-message-date-overlay
(make-overlay (point-min) (point-min)))))
(defun mew-my-message-display-local-date ()
(condition-case err
diff --git a/twittering-mode.el b/twittering-mode.el
index 91e0156..c7bb4fe 100644
--- a/twittering-mode.el
+++ b/twittering-mode.el
@@ -515,6 +515,8 @@ StatusNet Service.")
(search-url . twittering-get-search-url-statusnet)))
"A list of alist of service methods.")
+(defvar twittering-favorites-timeline-page nil)
+
@mhayashi1120
mhayashi1120 / twittering-hashtag.patch
Created July 30, 2011 16:27
twittering-hashtag-patch
diff --git a/twittering-mode.el b/twittering-mode.el
index 91e0156..b1301ec 100644
--- a/twittering-mode.el
+++ b/twittering-mode.el
@@ -3384,6 +3384,9 @@ Before calling this, you have to configure `twittering-bitly-login' and
;; Unicode Character 'FULLWIDTH COMMERCIAL AT' (U+FF20)
(concat "\\(?:@\\|" (char-to-string full-width-commercial-at) "\\)")))
+(defvar twittering-regexp-hashtag-words
+ "\\(\\(?:\\w\\|[_-]\\)+\\)")
@mhayashi1120
mhayashi1120 / twittering-stream.el
Created July 16, 2011 06:54
twitter stream mode parasite to twittering-mode
;;; twittering-stream.el --- Twitter stream extension.
;; Author: Masahiro Hayashi <[email protected]>
;; Keywords: twitter user stream
;; Emacs: GNU Emacs 22 or later
;; Version: 0.0.2
;; Package-Requires: ((json "1.2") (twittering-mode "2.0"))
;; This program is free software; you can redistribute it and/or
;; modify it under the terms of the GNU General Public License as