Skip to content

Instantly share code, notes, and snippets.

View shapr's full-sized avatar
🏃
VENTRE À TERRE

Shae Erisson shapr

🏃
VENTRE À TERRE
View GitHub Profile
@shapr
shapr / org-idle-timer.el
Created November 4, 2021 22:17
show org-mode todo when emacs is idle
;; timer variable
(defvar idle-timer-show-org-agenda-timer nil)
;; start function
(defun se/idle-timer-show-org-agenda-start ()
(interactive)
(when (timerp idle-timer-show-org-agenda-timer)
(cancel-timer idle-timer-show-org-agenda-timer))
(setq idle-timer-show-org-agenda-timer
(run-with-idle-timer (* 10 60) 1 #'org-agenda-list)))
;;lsp-doctor suggestions https://emacs-lsp.github.io/lsp-mode/page/performance/
(setq gc-cons-threshold 100000000)
(setq read-process-output-max (* 1024 1024)) ;; 1mb
(setq lsp-idle-delay 0.500)
(use-package lsp-treemacs
:ensure t)
(use-package lsp-mode
:ensure t
:hook ((rust-mode . lsp)
$ cabal v2-run ./install.hs --project-file install/shake.project 8.10.7
Resolving dependencies...
Build profile: -w ghc-8.10.7 -O1
In order, the following will be built (use -v for more details):
- fake-package-0 (exe:script) (configuration changed)
Configuring executable 'script' for fake-package-0..
Preprocessing executable 'script' for fake-package-0..
Building executable 'script' for fake-package-0..
[1 of 1] Compiling Main ( Main.hs, /home/shae/build/haskell-language-server/dist-newstyle/build/x86_64-linux/ghc-8.10.7/fake-package-0/x/script/build/script/script-tmp/Main.o )
Linking /home/shae/build/haskell-language-server/dist-newstyle/build/x86_64-linux/ghc-8.10.7/fake-package-0/x/script/build/script/script ...
@shapr
shapr / lsp.el
Created September 5, 2021 18:46
(use-package lsp-ui
:ensure t
:after (lsp-mode)
:hook ((lsp-mode . lsp-ui-mode)
(lsp-mode . flycheck-mode))
:config
(setq lsp-prefer-flymake nil)
)
@shapr
shapr / julius.nix
Last active June 6, 2021 23:07
julius.nix
{ lib, stdenv
, SDL2
, alsaLib
, autoconf
, automake
, cmake
, gcc
, git
, lapack
, libpulseaudio
;; useful trick from https://www.reddit.com/r/emacs/comments/idz35e/emacs_27_can_take_svg_screenshots_of_itself/
(defun screenshot-svg ()
"Save a screenshot of the current frame as an SVG image.
Saves to a temp file and puts the filename in the kill ring."
(interactive)
(let* ((filename (make-temp-file "Emacs" nil ".svg"))
(data (x-export-frames nil 'svg)))
(with-temp-file filename
(insert data))
(kill-new filename)
(use-package lsp-mode
:ensure t
:hook ((rust-mode . lsp)
(go-mode . lsp)
(python-mode . lsp)
(haskell-mode . lsp)
(js-mode . lsp))
:commands lsp-ui-mode
)
)
@shapr
shapr / try.sh
Created February 7, 2021 20:49
param confusion
# for long running commands
function try () {
bloohm "/dev/ttyACM0" Yellow $PWD:A "$*"
time $* && fin || die; # cargo install tally, replacement for time
}
function play_sound () {
aplay -N -q $HOME/.bin/$1.au
}
@shapr
shapr / parsehack.py
Last active February 7, 2021 18:35
parsing bloom filter neopixel set
import time
import board
import busio
import adafruit_trellism4
import adafruit_adxl34x
import supervisor
# Set up Trellis and accelerometer
trellis = adafruit_trellism4.TrellisM4Express(rotation=0)
i2c = busio.I2C(board.ACCELEROMETER_SCL, board.ACCELEROMETER_SDA)
@shapr
shapr / config
Created May 23, 2020 17:09
improve your ssh usage! add these wizardly tricks! add this to ~/.ssh/config !
Host *
ServerAliveInterval 15
ServerAliveCountMax 3
ControlMaster auto
ControlPath ~/.ssh/ssh-%h-%p-%r
ConnectionAttempts 2
ForwardAgent yes
ControlPersist 2m