Skip to content

Instantly share code, notes, and snippets.

View rauhs's full-sized avatar

Andre W. rauhs

  • Bavaria, Germany
View GitHub Profile
public class Issue1351
{
private readonly ITestOutputHelper output;
public Issue1351(ITestOutputHelper output)
{
this.output = output;
}
[Fact]
[{:kana [{:expr "サイズ", :romaji "saizu", :kana {:kata 3}, :pri {:common true}}],
:trans {:en {:PoS ["common noun"], :exprs [["size"]]},
:fr {:PoS ["common noun"], :exprs [["taille"]]},
:de {:PoS ["common noun"], :exprs [["Größe" "Nummer" "Format" "Kleidergröße"]]},
:hu {:PoS ["common noun"], :exprs [["enyv" "ragasztóanyag" "terjedelem"]]},
:ru {:PoS ["common noun"], :exprs [["((англ.) size) размер, величина; формат"]]},
:sl {:PoS ["common noun"], :exprs [["mera" "velikost" "konfekcijska številka"]]},
:es {:PoS ["common noun"], :exprs [["tamaño " "magnitud"]]},
:sv {:PoS ["common noun"], :exprs [["format"]]}},
:other []}
@rauhs
rauhs / spy.clj
Created February 10, 2018 17:58
(ns spy.core)
(defn- get-hostname []
(.. java.net.InetAddress getLocalHost getHostName))
(def debug?
"ADAPT ME!!"
(delay (or (= "dev" (System/getProperty "nomad.env"))
(= (get-hostname) "sky"))))
;; Utility functions:
;; Space separted number values:
(defn ssn [s] (mapv #(Long/parseLong %) (str/split s #"\s+")))
(defn simple-md-parser
"Simple markdown parser."
[s special]
(let [it (iter s)
out-state (fn [out text state]
(conj out {:text text
:state (into [] (keep (fn [[k v]]
(when v k))) state)}))]
(loop [out []
state {}
;; FROM: https://github.com/gfredericks/misquote
(defn- listish?
"Gets both lists and lazy seqs."
[ob]
(and (sequential? ob) (not (vector? ob))))
(defn- unquote-form?
[form]
(and (listish? form)
(def kw-cache #js{})
(defn cached-kw [fqn]
(if-some [kw (unchecked-get kw-cache fqn)]
kw
(let [kw (keyword fqn)]
(unchecked-set kw-cache fqn kw)
kw)))
(defn js->clj-fast
(ns ansible.core
(:require [clojure.java.shell :as sh]
[clojure.string :as str]
[cheshire.core :as cheshire]
[clojure.java.io :as io])
(:import (java.io File)
(com.fasterxml.jackson.core JsonGenerator)
(java.util Base64)
(java.security MessageDigest MessageDigest$Delegate)))
(defmacro with-temp-files
"Create a block where `varname` is a temporary `File` containing `content`."
[bindings & body]
(let [bindings (partition 2 bindings)]
`(let ~(into []
(mapcat
(fn [[bind-name content]]
`[~bind-name (File/createTempFile ~(str bind-name) ".json")]))
bindings)
~@(mapv
(ns v8.core
"
Start Chrome with:
google-chrome-beta --js-flags=\"--allow-natives-syntax\"
")
(defn v8
"Runs a v8 natives syntax command with eval."
([c]