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
style = defaultWithAlign | |
maxColumn = 111 | |
rewrite.rules = [ | |
SortImports | |
RedundantBraces | |
RedundantParens | |
PreferCurlyFors | |
] | |
rewrite.redundantBraces.stringInterpolation = 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
def time[R](what: String)(block: => R): R = { | |
val t0 = java.lang.System.nanoTime() | |
val result = block | |
val ms = (java.lang.System.nanoTime() - t0) / 10e5.toInt | |
println(s"$what completed. Time elapsed: ${ms}ms") | |
result | |
} | |
def t[R](block: => R): R = { | |
val t0 = java.lang.System.nanoTime() |
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 gallery.server.io | |
"""Ns for interaction with server. Uses `fetch` API (required polyfill for some browsers) | |
Q: use goog.net.XhrIo instead? | |
""") |
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 hello.core | |
(:require [clojure.string :as str])) | |
(defn parse-int [^String n] | |
(Integer/parseInt n)) | |
(defn parse-cmd | |
[arg] | |
(let [splitted (str/split arg #"\s")] |
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
class Hash | |
def keywordize! | |
self.keys.each do |k| | |
if k.class == String | |
self[k.to_sym] = self[k] | |
self.delete(k) | |
end | |
end | |
self | |
end |
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 datascript-utils | |
(:require [datascript :as d])) | |
(defn data->datoms [prefix json] | |
(let [make-prefix | |
(fn [p] | |
(let [[full short] | |
(re-matches #"(.+?)s?$" p)] | |
short))] |
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 rumissue1.core | |
(:require [rum :include-macros true])) | |
(def errors (atom [])) | |
(def errors-count (atom 0)) | |
(defn error [msg] | |
(swap! errors-count inc) | |
(when (> (count @errors) | |
12) |
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
<link rel="import" href="../paper-button/paper-button.html"> | |
<link rel="import" href="../paper-checkbox/paper-checkbox.html"> | |
<polymer-element name="my-element"> | |
<template> | |
<style> | |
:host { | |
position: absolute; | |
width: 100%; |
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
(use 'clojure.core.async) | |
(defn req [server query] | |
(go | |
(<! (timeout (rand-int 100))) | |
(str query " from " server))) | |
(defn fastest [query & servers] | |
(let [c (chan)] | |
(doseq [server servers] |
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
#!/bin/sh | |
# Capture X11 with encoding to mp4 on fly with noise removal with sox | |
# and mixing both mic with game audio | |
# TODO: remove noise by pulseaudio | |
loadModule() { | |
# Pavucontrol guide | |
# playback: Send audio from the game to game_out | |
# record: stream from duplex_out | |
pacmd load-module module-null-sink sink_name=duplex_out sink_properties=device.description="duplex_out" |