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
"@" [(:eval.custom "\"@\"" {:result-type :replace :verbatim true})] |
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
(write-lines "sample.txt" ["あいう"] :encoding "Windows-31J") | |
(write-lines "sample2.txt" (range 10) :add-bom true :separator "x") |
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
package javassist.test; | |
import javassist.ClassPool; | |
import javassist.CtClass; | |
public class ExtendSample { | |
public static void main(String[] args) throws Exception{ | |
ClassPool pool = ClassPool.getDefault(); | |
CtClass cc = pool.makeClass("dynamic.clazz.Sample"); | |
cc.setSuperclass(pool.get("java.lang.String")); |
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
(files-glob "." "**/*.clj") |
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 [v (transient {})] | |
(dotimes [n 5] (assoc! v (keyword (str n)) n)) | |
(persistent! v)) |
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
user=> (require '[clojure.walk :as w]) | |
user=> (w/postwalk vector '(1 (2))) | |
[([1] [([2])])] | |
user=> (w/postwalk #(if (number? %) (- %) %) [2 [3] 4]) | |
[-2 [-3] -4] |
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
(ns camel-sample.core | |
(:import [org.apache.camel.impl DefaultCamelContext] | |
[org.apache.camel.builder RouteBuilder]) | |
(:gen-class)) | |
(let [context (DefaultCamelContext.)] | |
(.addRoutes context (proxy [RouteBuilder] [] | |
(configure [] (.. this | |
(from "file:src/camel_sample?noop=true") | |
(to "file:.?fileName=out.txt"))))) |
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
(def v (proxy [Object] [] | |
(toString [] (str :abc)))) | |
(with-meta v {:A 111}) |
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
(defn sequential-zip | |
[root] | |
(zipper sequential? | |
identity | |
(fn [node children] (with-meta children (meta node))) | |
root)) |
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
(ns lt.plugins.another-indent | |
(:require [clojure.string :as s] | |
[lt.objs.editor :as editor] | |
[lt.objs.editor.pool :as pool] | |
[lt.objs.command :as cmd]) | |
(:require-macros [lt.macros :refer [behavior]])) | |
;; 指定した行(文字列)のインデント数(スペース換算)を返す | |
(defn indent [line tab-size] | |
(let [size (- (count line) (count (s/triml line)))] |