Skip to content

Instantly share code, notes, and snippets.

@Chovin
Chovin / .zsh_completions.zsh
Last active January 3, 2024 07:17
ssh config autocomplete
# # https://thevaluable.dev/zsh-completion-guide-examples/
zstyle ':completion:*:*:*:*:descriptions' format '%F{green}-- %d --%f'
zstyle ':completion:*' menu select
# zstyle ':completion:*' file-list all
zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS}
# # Allow for autocomplete to be case insensitive
# # zstyle ':completion:*' matcher-list '' 'm:{[:lower:][:upper:]}={[:upper:][:lower:]}' \
@Chovin
Chovin / Udemy review flashcards.js
Last active October 24, 2020 19:54
Turn Udemy's review pages into flashcards by skipping the test, opening devtools, then pasting this in console
function addCSSRule(selector, rules, index) {
if (!window.the_added_sheet) {
style = document.createElement('style')
style.appendChild(document.createTextNode(""))
document.head.appendChild(style)
if ("insertRule" in sheet) {
sheet.insertRule(selector + "{" + rules + "}", index);
} else if ("addRule" in sheet) {
sheet.addRule(selector, rules, index);
}
@Chovin
Chovin / Open in subl.workflow
Created January 17, 2019 02:57
Open folder/file(s) in sublime w/ a keystroke. Pretty sure I got this from some stackoverflow but not sure where, sorry!
-- Run AppleScript
on run {input, parameters}
tell application "Finder"
set myWin to window 1
set loco to selection
if the number of items in loco is greater than 0 then
@Chovin
Chovin / .bashrc
Created October 12, 2018 10:43
bashrc for Hacktoberfest git workshop
### workshop stuff ###
# not sure where I got these..
# don't put duplicate lines or lines starting with space in the history.
# See bash(1) for more options
HISTCONTROL=ignoreboth
# append to the history file, don't overwrite it
shopt -s histappend
function <function_name>([param1] [,param2 ...])
-- your code here
end
-- examples:
function jump()
y = y + 10
end
function _init()
-- setup code
end
function _update()
-- code that changes things in the game
end
function _draw()
-- code that draws things to the screen
@Chovin
Chovin / pretty_the_force.frag
Created October 30, 2017 03:30
pretty GLSL using The_Force
// The Force and
vec3 roty(vec3 pt, float amt) {
//vec2 xz = rotate(vec2(pt.x, pt.z),vec2(0,0), amt);
//return vec3(xz.x, pt.y, xz.y);
float angle = atan(pt.x, pt.z)+amt;
float len = length(vec2(pt.x, pt.z));
return vec3(sin(angle)*len, pt.y, cos(angle)*len);
}
vec3 rotz(vec3 pt, float amt) {
@Chovin
Chovin / pico-8.md
Created October 10, 2017 07:46 — forked from orels1/pico-8.md
PICO-8 Starter Pack (via @irdumb)
@Chovin
Chovin / LiveCoding mac notes.md
Last active December 7, 2017 23:28
various startup / setup notes on some live coding environments

What Do, How Do, Live Code

Audio

FoxDot

  1. Open up SuperCollider
  2. cmd+open FoxDot/supercollider.sc
  3. cmd+enter execute each of these separately
-- this is a pico8(lua) comment. it is ignored by the program
-- first we set up some variables
z=0 -- this will be our index so we know what pixel we're on.
p={} -- we need to store all the pixels on the screen so we have a base set of pixels to manipulate
f=133 -- this will control how many pixels we try to read per line
-- notice, I chose a little more than 128 pixels. This is to adjust for sideways movement
-- as well as various timing things that use this as part of their calculation.
t=0 -- tick counter