Skip to content

Instantly share code, notes, and snippets.

View emanon001's full-sized avatar

emanon001 emanon001

View GitHub Profile
@syou6162
syou6162 / Jark.md
Created February 8, 2012 02:23
Jarkの使い方メモ

Jarkの使い方メモ

Clojureにはleiningenという便利なツールがありますが

  • 小さなスクリプト的な使い方をしたい
  • テストを小まめに走らせたい

などのときにlein自体の起動(というかjvmの起動)の遅さが気になってきます。どうにかしたいと思って調べていったところ、jarkというのが便利そうだったので、使い方を調べてみることにしました。

というか本家のほうでtest/script.clj --foo "a" --bar "b"という感じで動かせると書いてあるんですが、これだといくら頑張っても動かなかった。。。それとjark ns load XXX.cljもダメでした。なんでだろう。。。

@baopham
baopham / Monaco for Powerline.otf
Last active April 16, 2023 03:57
Patched font Monaco for OSX Vim-Powerline
@rosylilly
rosylilly / gist:3401612
Created August 20, 2012 06:40
先輩と覚える HTTP ステータスコード

先輩に学ぶ HTTP Status Code

超雑にまとめました。修正してください。

登場人物

  • アプリケーション先輩: いつも忙しい。横に広がるのが得意(デブじゃない)。
  • 後輩: 頼んでばっかしで役に立たない。
  • サーバー先輩: アプリケーション先輩と仲がいい。Unix Socket でつながるくらい仲良し。
  • プロクシ先輩: アプリケーション先輩とかサーバー先輩と後輩の間を取り持って代わりに伝えたりしてくれる。たまに勝手にレスポンスを書き換える。
@kuenishi
kuenishi / gist:3825178
Created October 3, 2012 05:22
Accessing to VM via serial console at VMware Fusion 5

Environment

  • Using FreeBSD
  • Mountain Lion
  • VMware Fusion 5
  • Your VMware is installed at '/Applications/VMware Fusion.app'
  • Command Line tools are at '/Applications/VMware Fusion.app/Contents/Library'
  • especially vmrun
@ponkore
ponkore / clojure-reader-macro.md
Created December 3, 2012 15:32
Clojure のリーダーマクロについて (lisp reader macro advent calendar 2012 の記事です)。

Clojure のリーダーマクロについて

この記事は、lispリーダーマクロアドベントカレンダー の4日目の記事です。 タイトルにある通り、Clojure でのリー ダーマクロについて取り扱います(対象とする Clojure のバージョンは 1.4)。

はじめに

@kohyama
kohyama / README.md
Last active October 13, 2015 19:18
Project Euler Problem 10

Project Euler Problem 10 解答とコメント

#clojure 入門者向け勉強会 #mitori_clj 第二週担当分

Project Euler Problem 10
2,000,000 未満の素数の総和を求めよ. とのことです.

結果を出すために手に入るリソースを有効活用するという考えのもとでは --この問題自体の解答を述べている

@kohyama
kohyama / clojure-tips.md
Created December 11, 2012 05:56
Clojure tips infrequently used

Clojure tips infrequently used

To get names of methods of a class

(map #(.getName %) (.getMethods java.io.File))
; -> ("equals" "toString" "hashCode" "compareTo" "compareTo" "getName" "length" "getParent" "isAbsolute" "getCanonicalPath" "setReadOnly" "list" "list" "delete" "getParentFile" "getPath" "getAbsolutePath" "getAbsoluteFile" "getCanonicalFile" "toURL" "toURI" "canRead" "canWrite" "exists" "isDirectory" "isFile" "isHidden" "lastModified" "createNewFile" "deleteOnExit" "listFiles" "listFiles" "listFiles" "mkdir" "mkdirs" "renameTo" "setLastModified" "setWritable" "setWritable" "setReadable" "setReadable" "setExecutable" "setExecutable" "canExecute" "listRoots" "getTotalSpace" "getFreeSpace" "getUsableSpace" "createTempFile" "createTempFile" "wait" "wait" "wait" "getClass" "notify" "notifyAll")
@ypsilon-takai
ypsilon-takai / pe_7.clj
Created December 11, 2012 12:32
project euler 7
;; 去年最初に解いたとき答え
;;
;; "Elapsed time: 106406.52058 msecs"
;; 今やっても時間が1分40秒もかかってしまうので、だめー。
;; 考えかた
;; ある数Nが素数であるかどうかは、√N以下の素数に割りきれるものがあるかどうかで判定します。
;; そのためには、そこまでに発見した素数を保持する必要があります。
;; あとは、2以上の数について、素数であるかどうかでフィルターします。
;;; Project Euler #8
;;; http://projecteuler.net/problem=8
;;; http://odz.sakura.ne.jp/projecteuler/index.php?cmd=read&page=Problem%208
(use 'clojure.test)
(def input
(str
"73167176531330624919225119674426574742355349194934"
"96983520312774506326239578318016984801869478851843"
@ponkore
ponkore / problem-4-1.clj
Created December 14, 2012 13:35
Project Euler Problem 4
;;;A palindromic number reads the same both ways.
;;;The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 99.
;;;Find the largest palindrome made from the product of two 3-digit numbers.
;;;左右どちらから読んでも同じ値になる数を回文数という。 2桁の数の積で表される回文数のうち、
;;;最大のものは 9009 = 91 × 99 である。
;;;では、3桁の数の積で表される回文数のうち最大のものはいくらになるか。
(ns projecteuler.problem-4
(:require [clojure.string :as str])