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
# -*- mode: snippet -*- | |
# name: golang method receiver | |
# key: sf | |
# -- | |
func (${1:`(save-excursion | |
(let ((re "^func (\\([^\\)]*\\))")) | |
(cond | |
((or | |
(re-search-backward re nil t) | |
(re-search-forward re nil t)) |
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
(defmacro define-background-function-wrapper (bg-function fn) | |
(let ((is-loading-sym (intern (concat "*" (symbol-name bg-function) "-is-loading*")))) | |
`(progn | |
(defvar ,is-loading-sym nil) | |
(defun ,bg-function () | |
(interactive) | |
(when ,is-loading-sym | |
(message ,(concat (symbol-name fn) " is already loading"))) | |
(setq ,is-loading-sym t) | |
(make-thread (lambda () |
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 my-fancy-startup-screen (&rest args) | |
(clear-image-cache) | |
(let* ((pwidth (window-pixel-width)) | |
(pheight (* pwidth 0.75)) | |
(file (expand-file-name "~/some-background.jpg")) | |
(tfile "/tmp/emacs-splash.jpg") | |
(color "white") | |
(font "/usr/share/fonts/corefonts/times.ttf") | |
(rt (/ pwidth 1000.0)) | |
(size1 (* 80.0 rt)) (size2 (* 16.0 rt)) (size3 (* 24.0 rt)) |
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
# ~/lib/goemon.yml と適当なCSSを準備。 | |
# mdのファイルのある場所で以下のコマンドで起動。 | |
# webサーバーはpythonでなくてもwebrickでもnginxでも何でも。 | |
goemon -c ~/lib/goemon.yml python2.7 -m SimpleHTTPServer |
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
# -*- mode: snippet -*- | |
# name: jsdoc comment | |
# key: doc | |
# -- | |
/** | |
* $0 | |
`(save-excursion | |
(let* ((pos-fun (re-search-forward "\\<function\\s-*(\\([^)]*\\))")) | |
(argstr (and pos-fun (match-string 1))) | |
(args (and pos-fun (split-string argstr ",\\s-*")))) |
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
import java.io.*; | |
public class ProcessRun { | |
public static void main(String[] args) throws IOException, InterruptedException { | |
Process p = Runtime.getRuntime().exec("locate javac"); | |
InputStream stdout = p.getInputStream(); | |
InputStream stderr = p.getErrorStream(); | |
int val = 0; | |
while (true) { | |
String so = readString(stdout); |
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
;;; calfw-git.el --- calendar view for git-log | |
;; Copyright (C) 2014 SAKURAI Masashi | |
;; Author: SAKURAI Masashi <m.sakurai at kiwanami.net> | |
;; Keywords: calendar | |
;; This program is free software; you can redistribute it and/or modify | |
;; it under the terms of the GNU General Public License as published by | |
;; the Free Software Foundation, either version 3 of the License, or |
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
(let* ((source1 | |
(lexical-let ((file "./some-schedule.org")) | |
(make-cfw:source | |
:name (concat "Org:" "TEST") | |
:data (lambda (begin end) | |
(let ((org-agenda-files (list file))) | |
(cfw:org-schedule-period-to-calendar begin end)))))) | |
(cp (cfw:create-calendar-component-buffer | |
:view 'month | |
:contents-sources (list source1) |
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
;;; syobo.el --- calfw for syoboi calendar | |
;; Copyright (C) 2014 @kiwanami | |
;; Author: @kiwanami | |
;; Keywords: calendar | |
;; This program is free software; you can redistribute it and/or modify | |
;; it under the terms of the GNU General Public License as published by | |
;; the Free Software Foundation, either version 3 of the License, or |
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 'calfw) | |
(cfw:open-calendar-buffer) |
NewerOlder