Skip to content

Instantly share code, notes, and snippets.

Avatar
👶
hello world!

Iizuka Masashi liquidz

👶
hello world!
View GitHub Profile
@liquidz
liquidz / cve_2022_21449.clj
Created Apr 20, 2022
CVE-2022-21449 checker
View cve_2022_21449.clj
(ns cve-2022-21449
(:import
(java.security
KeyPairGenerator
Signature)))
(def key-pair
(.. (KeyPairGenerator/getInstance "EC")
(generateKeyPair)))
View ddu_sonictemplate.vim
" 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
@liquidz
liquidz / aws_logs_core.clj
Last active Jun 3, 2021
AWS CLI wrapping script by Babashka
View aws_logs_core.clj
(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]))
View rg_root_files.vim
" 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,
\ }
View cljstache_test.clj
(let [tmpl (str/join "\n" ["first"
""
"{{#arr}}"
"{{val}}"
"{{/arr}}"
""
"{{#arr}}"
"{{val}}"
"{{/arr}}"
""
View gist:5b8036551cbde7db9dbe2264b1a9da2a
$ 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=>
View tiny_blockchain.clj
(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)
View Makefile
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)
View chotto_benri_na_vimrc.md
author uochan
date   2014/07/25
font   VL ゴシック 40
colorscheme hybrid

ちょっと便利になる(かもしれない)10行の.vimrc

@uochan

まずはじめに

View core.typed_annotation_patterns.md

core.typed: Annotation Patterns

core.typed dependencies: [org.clojure/core.typed "0.2.53"]

require: (require '[clojure.core.typed :as t])

Patterns

  • single param
(t/ann f1 [t/Str -> t/Str])