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
;(require 'cider) | |
(defun oneoff-cider-jack-in () | |
(interactive) | |
(if (null buffer-file-name) | |
(message "no file name") | |
(let ((cider-lein-parameters (format "oneoff --repl %s :headless" | |
(file-truename buffer-file-name)))) | |
(cider-jack-in)))) |
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
#include <stddef.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
struct address | |
{ | |
char name[50]; | |
char street[50]; | |
int phone; |
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
#include <stdio.h> | |
int main() | |
{ | |
int a = 0; | |
int *ptr = &a; | |
printf("intsize = %d\n", sizeof(int)); | |
printf("base = %p\n", ptr); |
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
(require 'dash) | |
(defconst PI 3.1415) | |
(defconst a 0.05) | |
(defvar scale-x 0.3 | |
"x軸拡大率") | |
(defvar scale-y 0.3 | |
"y軸拡大率") |
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
<?php | |
class Lazy | |
{ | |
public static function isClosure ($obj) | |
{ | |
return is_object($obj) && $obj instanceof Closure; | |
} | |
/** |
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
#!escript | |
;; ライブラリの読み込み | |
;; Loading...と標準エラー出力に出てしまう(escript側で出ないようにしている) | |
(load-file (expand-file-name "~/.emacs.d/cli-util.el")) | |
(load-file (expand-file-name "~/.emacs.d/el-get/dash/dash.el")) | |
(load-file (expand-file-name "~/.emacs.d/el-get/s/s.el")) | |
;; 組み込みライブラリの読み込み | |
(require 'json) |
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
;; cli utility functions | |
(defun println (str) | |
(princ (format "%s\n" str))) | |
(defun pp (obj) | |
(println (prin1-to-string obj))) |
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
#!/bin/bash | |
# | |
# emacs lispをスクリプトとして実行する | |
# 第一引数はelファイル、それ以降はそのelに渡す引数 | |
# 標準エラー出力への出力を抑制している | |
emacs --script $1 ${@:2:($#-1)} 2> /dev/null |
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
(def events [:move :press :move :move :release :press :release :press :press :move :move :move :release :move :move]) | |
(defn make-drag-filter-fn [] | |
(let [pressed? (atom false)] | |
(fn [event] | |
(cond | |
(and @pressed? (= :move event)) true | |
(= :press event) (do (reset! pressed? true) false) | |
(= :release event) (do (reset! pressed? false) false) | |
:else false)))) |
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
;; project.clj | |
(defproject hogehoge "0.1.0-SNAPSHOT" | |
:description "FIXME: write description" | |
:url "http://example.com/FIXME" | |
:dependencies [[org.clojure/clojure "1.7.0"] | |
[clj-webdriver "0.7.2"] | |
[com.codeborne/phantomjsdriver "1.2.1" | |
:exclusion [org.seleniumhq.selenium/selenium-java | |
org.seleniumhq.selenium/selenium-server | |
org.seleniumhq.selenium/selenium-remote-driver]] |
OlderNewer