This file contains 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
#!/opt/homebrew/bin/bb | |
(require '[clojure.pprint :as pp] | |
'[clojure.string :as str] | |
'[babashka.fs :as fs] | |
'[babashka.process :refer [shell]]) | |
(defn md-typst-filter [items] | |
(case (items :type) | |
:md (let [s (str/join "\n" (items :lines)) |
This file contains 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
// Drop this script in the Editor folder of your project | |
using System.Collections.Generic; | |
using UnityEngine; | |
using UnityEditor; | |
using System; | |
using System.Reflection; | |
using System.Linq; | |
using System.IO; | |
public class CreatePrefabWindow : EditorWindow |
This file contains 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
// first naive, straight-forward solution: | |
function divides(a,b) { | |
return a % b === 0; | |
} | |
for (i=1; i<20; i++) { | |
if (divides(i,3) && divides(i,5)) { | |
console.log("fizzbuzz"); | |
} else if (divides(i,3)) { |
This file contains 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
#!/usr/bin/env bb | |
; kolja (@01k) 2020 | |
; | |
; usage: | |
; | |
; create a directory where you would like to keep your bookmarks. | |
; create an env variable NNN_BMDIR with the path to that directory (e.g. "~/.config/nnn/bookmarks") | |
; save this file in ~/.config/nnn/plugins as "bookmark" (for example) | |
; |
This file contains 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
/* this is not the solution you are looking for. Move along */ | |
ul { | |
list-style-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='30' height='40' viewBox='-1 -1 2 2'><circle transform='translate(0,-1.7)' r='1' /><circle transform='translate(0,0.95)' r='1' /></svg>"); | |
line-height: 0.6rem; | |
} |
This file contains 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
#!/usr/bin/env bash | |
"exec" "plk" "-Sdeps" "{:deps {org.clojure/tools.cli {:mvn/version \"0.4.2\"}}}" "-Ksf" "$0" "$@" | |
(ns subtitles.core | |
(:require | |
[planck.http :as http] | |
[planck.core :as core] | |
[clojure.tools.cli :refer [parse-opts]] | |
[clojure.string :as s])) | |
(def help " |
This file contains 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
const split = (arr, fn) => arr.reduce(([first, ...rest],el) => | |
fn(el) | |
? first.length ? [[], first, ...rest] : [[], ...rest] | |
: first.length ? [[...first, el], ...rest] : [[el], ...rest] | |
, [[]]).reverse() | |
const a = [...Array(12).keys()] | |
split(a, x => !(x%5)) | |
// [ [ 1, 2, 3, 4 ], [ 6, 7, 8, 9 ], [ 11 ] ] |
This file contains 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 primes.core) | |
(defn- primes | |
"returns a lazy list of prime numbers via the sieve of eratosthenes" | |
([] | |
(primes (iterate inc 2))) | |
([[head & tail]] | |
(cons head | |
(lazy-seq (primes (remove #(and (not= % head) | |
(zero? (mod % head))) tail)))))) |
This file contains 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
#!/usr/local/bin/lumo | |
(ns balanced.core | |
(:require [lumo.core :refer [*command-line-args*]] | |
[clojure.string :refer [join]])) | |
(defn is-pair? [ch1 ch2] | |
(let [pairs {"(" ")" | |
"[" "]" | |
"{" "}"}] | |
(= (get pairs ch1) ch2))) |
NewerOlder