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
#!/usr/bin/env bb | |
(ns vega-serv) | |
(import (java.net ServerSocket)) | |
(require '[clojure.string :as string] | |
'[clojure.java.io :as io] | |
'[cheshire.core :as json] | |
'[clojure.tools.cli :refer [parse-opts]]) |
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
// three indices to efficiently support all lookups | |
function createDB() { | |
return {eav: new Map(), | |
ave: new Map(), | |
vea: new Map()}; | |
} | |
function addToIndex(xs, x, y, z, triple) { | |
let ys = xs.get(x); | |
if(ys == undefined) { |
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
;; Decompiling and pretty printing a WASM program such as "my_program.wasm": | |
;; | |
;; $ bb babashka_wasm.clj my_program.wasm | |
;; | |
;; Following WASM specs 1.1 | |
(require '[babashka.deps :as deps]) | |
(deps/add-deps '{:deps {io.helins/wasm {:mvn/version "0.0.0-alpha2"}}}) | |
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 org.graalvm.nativeimage.c.function.CFunction; | |
import org.graalvm.nativeimage.c.function.CFunction.Transition; | |
import org.graalvm.nativeimage.c.function.CLibrary; | |
import org.graalvm.nativeimage.c.CContext; | |
import org.graalvm.nativeimage.c.type.CCharPointer; | |
import com.oracle.svm.core.c.ProjectHeaderFile; | |
import org.graalvm.nativeimage.c.type.CTypeConversion; | |
import org.graalvm.nativeimage.c.type.CTypeConversion.CCharPointerHolder; | |
import java.util.List; | |
import java.util.Collections; |
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 webdav | |
(:require [clojure.string :as str] | |
[clojure.data.xml :as xml] | |
[org.httpkit.server :as hk-server])) | |
;; add the XML namespace that we'll use later | |
(xml/alias-uri 'd "DAV:") | |
(defn dissoc-in | |
"Should be in the standard library..." |
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 | |
print_usage() { | |
echo "usage: compress_video <input_file>" | |
echo "supported formats: mp4, webm, mkv, mov, avi, flv" | |
} | |
get_extension() { | |
f="${1##*/}" | |
case "$f" in |
OlderNewer