Skip to content

Instantly share code, notes, and snippets.

Avatar
👶
hello world!

Iizuka Masashi liquidz

👶
hello world!
View GitHub Profile
@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 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 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)
@liquidz
liquidz / core.clj
Created Apr 16, 2012
Clojure1.4 Reader Literals Test
View core.clj
(ns myreader.core
"Reader Literals Test"
(:require [clojure.string :as str]))
(defn debug-print
"Gauche debug print"
[x]
`(let [res# ~x]
(println "?=" res#)
res#))
@liquidz
liquidz / http.scala
Created Mar 3, 2010
OAuth Library for Scala
View http.scala
package com.uo.liquidz.http
import java.net.{URL, HttpURLConnection}
import java.io.{BufferedReader, InputStreamReader, BufferedWriter, OutputStreamWriter, IOException}
// ssl
import java.security.{KeyManagementException, NoSuchAlgorithmException, SecureRandom}
import java.security.cert.{CertificateException, X509Certificate}
import javax.net.ssl.{HttpsURLConnection, KeyManager, SSLContext, TrustManager, X509TrustManager}
import Simply._
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])
View .vimperatorrc
" 検索語を強調表示
set hlsearch
" j/k での移動量を3行に
map j 5<C-e>
map k 5<C-y>
" H/L でタブ移動
map H gT
map L gt