Skip to content

Instantly share code, notes, and snippets.

@rangeoshun
rangeoshun / config.el
Last active June 12, 2023 15:45
Typescript with CSS in JS (styled-components, Emotion), JSX and graphql highlight and major mode for Emacs Doom with `mmm-mode` for *.tsx
;; Assign typescript-mode to .tsx files
(add-to-list 'auto-mode-alist '("\\.tsx\\'" . typescript-mode))
(require 'mmm-mode)
(setq mmm-global-mode t)
(setq mmm-submode-decoration-level 0) ;; Turn off background highlight
;; Add css mode for CSS in JS blocks
(mmm-add-classes
'((mmm-styled-mode
@rangeoshun
rangeoshun / fbench.js
Last active November 15, 2020 17:22
JS optimization benchmark
const { performance } = require("perf_hooks");
const asciichart = require("asciichart");
const sort = (arr) => arr.slice().sort((a, b) => a - b);
const median = (arr) => {
const mid = Math.floor(arr.length / 2),
nums = sort(arr);
return arr.length % 2 !== 0 ? nums[mid] : (nums[mid - 1] + nums[mid]) / 2;
};
@rangeoshun
rangeoshun / outrun-electric.itermcolors
Created November 25, 2020 14:47
Outrun Electric Iterm2 Coloscheme
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Ansi 0 Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>0.12549020349979401</real>
@rangeoshun
rangeoshun / karabiner.json
Last active April 12, 2023 06:33
Layers for the virtual modifiers `japanese_eisuu` and `japanese_kana` keys.
{
"global": {
"ask_for_confirmation_before_quitting": true,
"check_for_updates_on_startup": true,
"show_in_menu_bar": true,
"show_profile_name_in_menu_bar": false,
"unsafe_ui": false
},
"profiles": [
{