Skip to content

Instantly share code, notes, and snippets.

@ryanzyy
ryanzyy / config
Last active Apr 1, 2020
i3 config
View config
set $super Mod4
set $alt Mod1
# composite manager
exec --no-startup-id picom -b
# set font
font pango: Noto Sans 8
# Use Mouse+$super to drag floating windows to their wanted position
View .zshrc
export EDITOR='nvim'
export ZSH=$HOME/.oh-my-zsh
ZSH_THEME="risto"
plugins=(git gitignore systemd)
source $ZSH/oh-my-zsh.sh
bindkey -v
bindkey ^O vi-cmd-mode
View compile-vim-msys2.md

Configure msys2

pacman -S base-devel mingw-w64-x86_64-toolchain mingw-w64-x86_64-cmake

Clone VIM

git clone https://github.com/vim/vim --depth=1

Modify src\Make_ming.mak

OLE=yes
GUI=yes
@ryanzyy
ryanzyy / prime.js
Created Mar 9, 2017
Get Prime Numbers using JavaScript Generator [ECMAScript]
View prime.js
function* from(i) { while (true) { yield i; i++; } }
function* genFilter(gen, cond) {
for (let e of gen) { if (cond(e)) yield e; }
}
function* prime(gen) {
let head = gen.next().value;
yield head;
yield* prime(genFilter(gen, (x) => x % head !== 0));
View sketchup-sugar.rb
Sketchup.send_action('showRubyPanel:')
$m = Sketchup.active_model
$s = Sketchup.active_model.selection
$v = Sketchup.active_model.active_view
$c = Sketchup.active_model.active_view.camera
def dcross(*a)
opt = a.last.is_a?(Hash) ? a.pop : {}
new_group = $m.entities.add_group
@ryanzyy
ryanzyy / vbox_port.rb
Created Feb 10, 2015
vbox port forwarding
View vbox_port.rb
vbox_manger = 'C:\Program Files\Oracle\VirtualBox\VBoxManage.exe'
(8000..8100).each do |p|
`"#{vbox_manger}" modifyvm "local-ubuntu" --natpf1 "port #{p},tcp,,#{p},,#{p}"`
end
#delete:
# `"#{vbox_manger}" modifyvm "local-ubuntu" --natpf1 delete "port #{p}"
@ryanzyy
ryanzyy / find_puts
Created Feb 10, 2015
find_all_puts_not_in_comment
View find_puts
# need ack
ack --ruby '^\s{0,}.*\sputs.*$' | sed -E 's/^(.*:\s*#.*$)//g'
@ryanzyy
ryanzyy / .tmux.conf
Last active Oct 17, 2018
Tmux Config
View .tmux.conf
set -g default-terminal "screen-256color"
set-window-option -g mode-keys vi
set -g default-terminal 'tmux-256color'
set -as terminal-overrides ',xterm*:Tc:sitm=\E[3m'
@ryanzyy
ryanzyy / Windows Putty Monokai 16-Color Settings
Last active Aug 29, 2015
Windows Putty Monokai 16-Color Settings
View Windows Putty Monokai 16-Color Settings
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\SimonTatham\PuTTY\Sessions\my-session-name]
"Colour0"="165,159,133"
"Colour1"="248,248,242"
"Colour2"="39,40,34"
"Colour3"="56,56,48"
"Colour4"="39,40,34"
"Colour5"="245,244,241"
"Colour6"="39,40,34"