Profile Clojure Step by Step
Profile in CodeScene with async-profiler: Check that the following is set to 1:
cat /proc/sys/kernel/perf_event_paranoid
To set it do this:
echo 1 | sudo tee /proc/sys/kernel/perf_event_paranoid
Add the following to your project.clj (if you’re using leinigen):
:async-profiler {:jvm-opts ["-Djdk.attach.allowAttachSelf" "-XX:+UnlockDiagnosticVMOptions" "-XX:+DebugNonSafepoints"] :dependencies [[com.clojure-goes-fast/clj-async-profiler "1.0.0-alpha1"]]} Require the profiler in your ns, and add (proc/profile) around the interesting code
(require '[clj-async-profiler.core :as prof]) ;; Profile your expression:…
Read more ⟶
Refactoring Recommendations
…
Read more ⟶
Repeat dot command on visual selection
Nice vim trick
xmap <silent> . :normal .…
Read more ⟶
Using Plantuml from Vim
Creating diagrams is a great way to communicate with others. Writing in vim is a great way to communicate with yourself.
Combine them and it’s just great!
The resulting workflow: Just open a plantuml file and use :PlantumlOpen to launch a live reloading browser with the preview.
Pre-requisite software:
plantuml Required plugins:
Plug 'aklt/plantuml-syntax' " syntax hl for pumlPlug 'tyru/open-browser.vim' " hooks for opeing browserPlug 'weirongxu/plantuml-previewer.vim' " previewerIf you (like me) just love some ascii art, use the entr or similar here:…
Read more ⟶
TIL: Pipe Into Vim
Pipe text into Vim
docker exec containername cat /etc/nginx/conf.d/nginx.conf | vim - …
Read more ⟶
Initial commit
Blog efficently - workflow for writing in public with ease.
Setup My requirements are:
Control the whole process from the command line Write in markdown No server management Custom domain name Requirements 1-3 are easily satisfied by hugo.
Hugo supports rendering on github pages: https://gohugo.io/hosting-and-deployment/hosting-on-github/
CLI deployment Quoted from https://gohugo.io/hosting-and-deployment/hosting-on-github/
Create a (e.g. blog) repository on GitHub. This repository will contain Hugo’s content and other source files. Create a .…
Read more ⟶