Skip to content

Instantly share code, notes, and snippets.

clj -Sdeps '{:deps {org.simplejavamail/outlook-module {:mvn/version "8.8.3"} org.simplejavamail/simple-java-mail {:mvn/version "8.8.3"} }}' -e '(println (.getPlainText (org.simplejavamail.converter.EmailConverter/emlToEmail (slurp "email.eml"))))'
@Yasushi
Yasushi / - IDE Scripting.md
Last active April 6, 2024 06:23 — forked from gregsh/- IDE Scripting.md
IDE Scripting

Here are my attempts to script an IntelliJ-based IDE using javax.script.* API (ex-JSR-223).

The list of available scripting languages and engines:

  1. Groovy - built-in, via Groovy jars and <app>/lib/groovy-jsr223-xxx.jar
  2. JavaScript (Nashorn) - built-in, via Java Runtime <app>/jbr/... (deprecated and will be removed soon)
  3. JavaScript (GraalJS) - https://plugins.jetbrains.com/plugin/12548-intellij-scripting-javascript
  4. JPython - https://plugins.jetbrains.com/plugin/12471-intellij-scripting-python
  5. JRuby - https://plugins.jetbrains.com/plugin/12549-intellij-scripting-ruby
  6. Clojure - https://plugins.jetbrains.com/plugin/12469-intellij-scripting-clojure
@Yasushi
Yasushi / Dockerfile
Created December 27, 2020 04:26
jmh + perf + async-profiler container
FROM amazonlinux:2
RUN amazon-linux-extras enable corretto8
RUN yum -y install java-1.8.0-amazon-corretto-devel sudo vim perf tar && yum -y clean all
RUN curl -sL https://github.com/jvm-profiling-tools/async-profiler/releases/download/v1.8.2/async-profiler-1.8.2-linux-x64.tar.gz -o /tmp/async-profiler-1.8.2-linux-x64.tar.gz \
&& mkdir /usr/local/async-profiler \
&& tar xf /tmp/async-profiler-1.8.2-linux-x64.tar.gz --strip-components 1 -C /usr/local/async-profiler \
&& cp /usr/local/async-profiler/build/libasyncProfiler.so /lib64
ffmpeg -f image2 -framerate 1 -loop 1 -video_size 900x900 -i soundonly_3_re.jpg -pix_fmt yuv420p -t 10 -r 1 -s 900x900 so3.mp4
#!/bin/sh
#
# An example hook script to verify what is about to be committed.
# Called by "git commit" with no arguments. The hook should
# exit with non-zero status after issuing an appropriate message if
# it wants to stop the commit.
#
# To enable this hook, rename this file to "pre-commit".
if git rev-parse --verify HEAD >/dev/null 2>&1
@Yasushi
Yasushi / Dockerfile
Created August 13, 2018 06:44
embulk docker
FROM debian:stretch-slim AS build
RUN apt-get update && apt-get -y --no-install-recommends install wget ca-certificates && wget -O /embulk "https://dl.bintray.com/embulk/maven/embulk-0.9.7.jar"
FROM openjdk:8-slim
COPY --from=build /embulk /usr/local/bin/embulk
RUN chmod 755 /usr/local/bin/embulk
RUN useradd -m -u 1000 user
USER user
#!/usr/bin/env python3
# -*- coding: utf-8; -*-
import sys, os, glob, itertools, re, functools, pprint
from collections import OrderedDict
from lxml import etree
from ebooklib import epub
@Yasushi
Yasushi / keybase.md
Created March 30, 2018 00:43
Keybase proof

Keybase proof

I hereby claim:

  • I am yasushi on github.
  • I am yasushia (https://keybase.io/yasushia) on keybase.
  • I have a public key ASA5vTNYB_jBJ4PtfhUxo_TFM2qkUTIcNiLfn5nnonV_2Qo

To claim this, I am signing this object:

hdiutil makehybrid -iso -joliet -o test.iso ./root
pinentry-program /usr/local/bin/pinentry-mac