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
" requires https://github.com/liquidz/ddu-source-custom-list | |
" cf. https://github.com/mattn/vim-sonictemplate/blob/master/autoload/fzf/sonictemplate.vim | |
function! s:ddu_sonictemplate() abort | |
let id = denops#callback#register( | |
\ {s -> sonictemplate#apply(s, 'n')}, | |
\ {'once': v:true}) | |
call ddu#start({'sources': [ | |
\ {'name': 'custom-list', | |
\ 'params': {'texts': sonictemplate#complete('', '', 0), 'callbackId': id}}]}) | |
endfunction |
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
; cf. | |
; http://briancarper.net/blog/449/clojure-reader-macros | |
; http://d.hatena.ne.jp/nokturnalmortum/20100527/1274961805 | |
(ns partial-reader | |
(import [clojure.lang LispReader LispReader$ListReader Cons Symbol])) | |
(defn dispatch-reader-macro [ch fun] | |
(let [dm (.get (doto (.getDeclaredField LispReader "dispatchMacros") | |
(.setAccessible true)) |
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 foo | |
(:require | |
[babashka.pods :as pods])) | |
;; Babashka pods として clj-kondo を読み込む | |
;; clj-kondo コマンドへのパスが通っている必要あり | |
;; もし clj-kondo コマンドを持っていない場合は Pod registry も利用可能 | |
;; https://github.com/babashka/pod-registry | |
(pods/load-pod "clj-kondo") |
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 cve-2022-21449 | |
(:import | |
(java.security | |
KeyPairGenerator | |
Signature))) | |
(def key-pair | |
(.. (KeyPairGenerator/getInstance "EC") | |
(generateKeyPair))) |
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 aws.logs.core | |
"AWS CLI wrapper for `logs` service | |
https://docs.aws.amazon.com/cli/latest/reference/logs/index.html | |
You need to install AWS CLI and run `aws configure` beforehand." | |
(:require | |
[cheshire.core :as json] | |
[clojure.java.shell :as shell] | |
[clojure.string :as str])) |
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
" autoload/clap/provider/rg_root_files.vim | |
" nnoremap <C-p> :<C-u>Clap rg_root_files ++externalfilter=fzf +async<CR> | |
let s:save_cpo = &cpoptions | |
set cpoptions&vim | |
let s:rg_root_files = { | |
\ 'sink': 'e', | |
\ 'enable_rooter': v:true, | |
\ } |
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
(let [tmpl (str/join "\n" ["first" | |
"" | |
"{{#arr}}" | |
"{{val}}" | |
"{{/arr}}" | |
"" | |
"{{#arr}}" | |
"{{val}}" | |
"{{/arr}}" | |
"" |
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
$ docker run -it clojure:tools-deps | |
Clojure 1.10.0 | |
user=> (java.net.URL. nil) | |
Execution error (NullPointerException) at java.net.URL/<init> (URL.java:532). | |
null | |
user=> (try (java.net.URL. nil) (catch java.net.MalformedURLException _ "faaaa")) | |
"faaaa" | |
user=> |
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
DROPLET_NAME = mytest | |
KEY_NAME = termux | |
DOCTL = $(GOPATH)/bin/doctl | |
CONFIG = $(HOME)/.config/doctl/config.yaml | |
DO_REGION = sgp1 | |
DO_IMAGE = ubuntu-16-10-x64 | |
DO_SIZE = 512mb | |
all: $(DOCTL) $(CONFIG) |
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 clj-tiny-blockchain.core | |
(:require [buddy.hashers :as hashers] | |
[java-time :as t])) | |
(defn- now [] | |
(t/local-date-time)) | |
(defn- hash-block [m] | |
(let [{:keys [index timestamp data previous-hash]} m] | |
(-> (str index timestamp data previous-hash) |
NewerOlder