Skip to content

Instantly share code, notes, and snippets.

@andrwj
andrwj / composing-software.md
Created June 14, 2020 15:22 — forked from rosario/composing-software.md
Eric Elliott's Composing Software Series
@andrwj
andrwj / colorscheme-override.md
Created June 2, 2020 05:46 — forked from romainl/colorscheme-override.md
The right way to override any highlighting if you don't want to edit the colorscheme file directly

The right way to override any highlighting if you don't want to edit the colorscheme file directly

Suppose you have weird taste and you absolutely want:

  • your visual selection to always have a green background and black foreground,
  • your active statusline to always have a white background and red foreground,
  • your very own deep blue background.

Your first reflex is probably to put those lines somewhere in your vimrc:

@andrwj
andrwj / install_emscripten.bat
Created May 12, 2020 07:40 — forked from marcusbelcher/install_emscripten.bat
Install Emscripten / Emsdk on Windows 10 via CMD
git clone https://github.com/juj/emsdk.git
cd emsdk
rd /s /q clang
rd /s /q emscripten
rd /s /q java
rd /s /q node
rd /s /q python
rd /s /q zips
git reset --hard HEAD
git checkout master
@andrwj
andrwj / nginx-tuning.md
Created July 30, 2019 20:24 — forked from denji/nginx-tuning.md
NGINX tuning for best performance

NGINX Tuning For Best Performance

For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.

Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.

You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.

@andrwj
andrwj / egos_throttle.sh
Created July 1, 2019 14:41 — forked from golimpio/egos_throttle.sh
Run cputhrottle for a list of applications in order to limit their CPU usage.
#!/bin/bash
# Run cputhrottle for a list of applications in order to limit their CPU usage.
# This script needs `pidof` and `cputhrottle` installed, which can be installed from homebrew.
# NOTE: This script was tested on MacOS only.
if [[ $EUID > 0 ]]; then
echo "Please run this script as root/sudo"
exit 1
fi
@andrwj
andrwj / fast-clojure-hello-world-using-graal-vm.md
Created March 1, 2019 15:31 — forked from asimjalis/fast-clojure-hello-world-using-graal-vm.md
How To Speed Up Clojure Hello World 100x Using GraalVM

How To Speed Up Clojure Hello World 100x Using GraalVM

Performance

Version Command Time (seconds)
Java time java -jar target/fastclj-1.0-standalone.jar 1.354
GraalVM time ./fastclj-1.0-standalone 0.014

Details

@andrwj
andrwj / bash-array-shift.sh
Created February 2, 2019 09:47 — forked from Integralist/bash-array-shift.sh
Zsh and Bash Array Shift (remove first item from the Array)
array=(foo, bar, baz)
echo ${array[@]} # => foo, bar, baz
array=("${array[@]:1}")
echo ${array[@]} # => bar, baz
array=("${array[@]:1}")
echo ${array[@]} # => baz
@andrwj
andrwj / mu4e-config-emacs
Created December 2, 2018 02:30 — forked from jackbaty/mu4e-config-emacs
My mail (mu4e) configuration section of .spacemacs
;; Mu4e ------------------------------------------------------------------------
;; Mail Mu4e
(require 'org-mu4e)
(setq mu4e-maildir "~/Mail")
(setq mu4e-user-mail-address-list '("jack@fusionary.com" "jack@baty.net") )
;;store link to message if in header view if nil - header query if t
(setq org-mu4e-link-query-in-headers-mode t)
@andrwj
andrwj / loading.org
Created November 23, 2018 08:34 — forked from TheBB/loading.org
Loading in Spacemacs

Emacs packages, features, files, layers, extensions, auto-loading, require, provide, use-package… All these terms getting you confused? Let’s clear up a few things.

Files

Emacs files contains code that can be evaluated. When evaluated, the functions, macros and modes defined in that file become available to the current Emacs session. Henceforth, this will be termed as loading a file.

One major problem is to ensure that all the correct files are loaded, and in the