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
(defmacro format-js [s] | |
`(-> ~s | |
~@(for [[to-replace replacement] (re-seq #"\{([^\}]+)}" s)] | |
`(string/replace-first ~to-replace ~(read-string replacement))))) |
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 scripts.simplify-svg | |
(:require | |
[clojure.string :as string]) | |
(:import | |
java.text.DecimalFormat)) | |
(defn- map-rest [f [x & rest]] | |
(conj | |
(map f rest) | |
x)) |
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 email-edit.core | |
(:import | |
java.util.Base64)) | |
(def encoder (Base64/getMimeEncoder)) | |
(def decoder (Base64/getMimeDecoder)) | |
(defn decode [^String s] | |
(String. (.decode decoder s))) | |
(defn encode [^String s] |
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 -i | |
;; Usage: | |
;; Install babashka at https://github.com/babashka/babashka | |
;; put this script on PATH and make it executable | |
;; copy logs to the clipboard | |
;; to filter SimpleAsyncTaskExecutor-3 run | |
;; pbpaste | slct.clj 3 | |
(require '[clojure.string :as string]) |
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
import java.awt.*; | |
import java.time.LocalDateTime; | |
public class MouseMover { | |
public static final int PAUSE = 20000; | |
public static void main(String... args) throws Exception { | |
int limit = args.length == 0 ? 24 : Integer.parseInt(args[0]); | |
System.out.println("Time limit: " + limit); |
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 test.core | |
(:import [java.awt.datatransfer DataFlavor StringSelection Transferable])) | |
(defn clipboard [] | |
(.getSystemClipboard (java.awt.Toolkit/getDefaultToolkit))) | |
(defn slurp-clipboard [] | |
(.getTransferData (.getContents (clipboard) nil) (DataFlavor/allHtmlFlavor))) | |
(def html-flavors |
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
-- run as cat sqlite.sql | sqlite3 | |
CREATE TABLE ichiba ( | |
disp_date INTEGER, | |
genre3_id INTEGER, | |
gms REAL, | |
order_cnt INTEGER | |
); | |
.mode tabs |
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
setInterval(() => document.body.querySelector('.video-button').click(), 1000); |
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 test.encoder | |
(:require | |
[clojure.string :as string])) | |
(def alphabet "ABCDEFGHIJKLMNOPQRSTUVWXYZ") | |
(def alphabet? (set alphabet)) | |
(def a->i (zipmap alphabet (range 1 27))) | |
(def i->a (zipmap (range 1 27) alphabet)) |
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
var net = require('net'); | |
const evalToBuffer = d => { | |
try { | |
const result = eval(d.toString()); | |
return Buffer.from(result + '\n', "utf-8"); | |
} catch (e) { | |
return Buffer.from(e + '\n', "utf-8"); | |
} | |
}; |
NewerOlder