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
#_(map #(* 3 %) (range 9)) |
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
(4 4 4 13 5 8 5 7 7 0 7 66) |
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.cursorkit | |
(:require [lt.objs.command :as cmd] | |
[lt.objs.editor :as editor] | |
[lt.objs.editor.pool :as pool])) | |
(defn cm [] (editor/->cm-ed (pool/last-active))) | |
(cmd/command {:command ::extend-true | |
:desc "cursorkit: Set Extending true" | |
:exec (fn [] (.setExtending (cm) 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
import java.util.Arrays; | |
import java.util.stream.IntStream; | |
public class FizzBuzz { | |
public static void main(String... args){ | |
Object[][] o = {{15, "FizzBuzz"}, {5, "Buzz"}, {3, "Fizz"}}; | |
IntStream.rangeClosed(1, 100).mapToObj(x -> | |
Arrays.stream(o).filter(p -> x % (int)p[0] == 0).map(p -> p[1]).findFirst().orElse(String.valueOf(x)) | |
).forEach(System.out::println); | |
} |
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
"<div>:sample</div>" | |
"<div style=\"color:red; margin: 5px\"></div>" | |
"<div style=\"color:red; margin: 5px\">123</div>" |
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- namify [type keyword] | |
(symbol (str "__" type "__" (.replace (name keyword) "." "__DOT__")))) | |
(defmacro behavior [name & {:keys [reaction] :as r}] | |
(if (and (seq? reaction) (= 'fn (first reaction))) | |
(let [[_ args & body] reaction] | |
`(do | |
(defn- ~(namify "BEH" name) ~args ~@body) | |
(lt.object/behavior* ~name ~@(apply concat (assoc r :reaction (namify "BEH" name)))))) | |
`(lt.object/behavior* ~name ~@(apply concat r)))) |
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
(or force-obj | |
(identical? x (js/Object x)) | |
(identical? (type x) js/Object) | |
(identical? (type x) js/global.Object)) |
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
body | |
#loader //"起動時の画面。起動後はopacity: 0;" | |
#wrapper | |
#canvas | |
#multi //"中心部分" | |
.tabsets | |
.tabset | |
.tabset | |
... | |
span.button.fullscreen //"フルスクリーン時の閉じるボタン" |
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 clj->js | |
"Recursively transforms ClojureScript values to JavaScript. | |
sets/vectors/lists become Arrays, Keywords and Symbol become Strings, | |
Maps become Objects. Arbitrary keys are encoded to by key->js." | |
[x] | |
(when-not (nil? x) | |
(if (satisfies? IEncodeJS x) | |
(-clj->js x) | |
(cond | |
(keyword? x) (name 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
"alt-s" [:editor.sublime.selectNextOccurrence (:eval.custom "(with-out-str (clojure.repl/source __SELECTION__))" {:verbatim true})] |