Skip to content

Instantly share code, notes, and snippets.

View alexkuhl's full-sized avatar

Alex Kuhl alexkuhl

View GitHub Profile
@alexkuhl
alexkuhl / mac_terminal_setup.txt
Last active February 10, 2023 15:09
Mac Terminal Setup
https://medium.com/seokjunhong/customize-the-terminal-zsh-iterm2-powerlevel10k-complete-guide-for-beginners-35c4ba439055
iterm2 with profile > color > preset to Tango Dark
ohmyzsh
powerlevel10k - https://github.com/romkatv/powerlevel10k
install k for better ls - https://github.com/supercrabtree/k
In iTerm profile > keys set left/right option key to Esc+ --> this allows for alt+backspace and command+backspace to delete block and line, respectively
go to key mappings, add new, press alt+left arrow for the shortcut, set action to send escape sequence, then b for Esc+
do the same for alt+right arrow with f, these set backward and forward cursor jumps
@alexkuhl
alexkuhl / pythagorean_tree.html
Last active December 11, 2015 19:30
Pythagorean Tree - draw a PTree using HTML5 canvas
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<canvas id="ptcanvas" width="400" height="400" style="border:1px dotted;float:left"></canvas>
<script>
function draw_square( ctx, x1, y1, x2, y2, x3, y3, x4, y4 )
{
ctx.beginPath( ) ;
@alexkuhl
alexkuhl / cs_cheat_sheet.txt
Created October 17, 2015 16:24
Computer Science "Cheat Sheet"
This "cheat sheet" is designed to be a super-high level view of common and/or important computer science concepts. Good for test reviews, preparing for job interviews, brushing up on the basics, becoming a better person, or light reading for putting your significant other to sleep. I will continue to update this so if you have any suggestions or corrections please send a pull request or contact me. Licensed under http://creativecommons.org/licenses/by-sa/3.0/.
Algorithms
+ Limiting behavior (all the second sections are as limit(n)->infinity)
* Big O - f is bounded by g :: f(n) <= g(n)*c (for some constant c) :: an upper bound, can be much higher than actual performance because this is not a tight bound, for example a log(n) algorithm technically is O(n!) but is obviously way better than something that actually gets n! performance
* Small or Little o - f dominated by g :: f(n) < g(n)*c; f(n)/g(n) = 0 :: g gets much larger
* Big Omega - f is bounded below by g :: |f(n)| >= g(n)*c :: a lower bound, bu
@alexkuhl
alexkuhl / .vimrc
Last active May 4, 2018 14:48
Linux dot files
"+++[[[indentation]]]+++++++++++++++++++++++++++++++++++++++++++++++++++++++++
set expandtab " use spaces when <TAB> is inserted
set shiftwidth=2 " number of spaces to use for (auto)indent step
set tabstop=2 " number of spaces that <Tab> in file uses
set autoindent " indent as last
"+++[[[search]]]+++++++++++++++++++++++++++++++++++++++++++++++++++++++++
set hlsearch " Highlight all found items
set incsearch " Show first match while still typing
@alexkuhl
alexkuhl / .bashrc
Last active September 25, 2015 01:38
Linux dot files
export LS_OPTIONS='--color=auto'
eval "`dircolors`"
alias ls='ls $LS_OPTIONS -CF'
alias ll='ls $LS_OPTIONS -Flha'
alias lldf='ls $LS_OPTIONS -Flha --group-directories-first'
@alexkuhl
alexkuhl / color_conversion_library.hpp
Created November 27, 2010 17:08
An easy-to-use and understand C++ library for colorspace conversions. Currently works with RGB <-> HSL/HSV. Will probably add more in the future.
/*
Copyright (c) 2010, Alex Kuhl, http://www.alexkuhl.org
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.