Skip to content

Instantly share code, notes, and snippets.

View remyhunt's full-sized avatar
▫️

Remy Hunter remyhunt

▫️
View GitHub Profile
@remyhunt
remyhunt / darkmode.js
Created March 28, 2022 22:30
vanilla darkmode for my personal site.
const toggle = document.getElementById("toggle");
const html = document.getElementsByTagName("html")[0];
const noti = document.getElementById("darkmode-notification");
const today = new Date();
const hours = today.getHours();
const textLight = "#777";
const textDark = "#aaa";
const detected = ["", ": matched to system UI preference.", ": set by browser local time."];
/* a simple but elegant map function that I pretty much find myself needing. */
function map(x, in_min, in_max, out_min, out_max) {
return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;
}
/* Because I always forget how to do this.. */
@font-face {
font-family: "My-Special-Font";
src: url("fonts/mySpecialFont-Regular.ttf") format("truetype");
}
@remyhunt
remyhunt / .bashrc
Last active January 4, 2017 18:05
my .bashrc
# always forget this command '$source ~/.bash_profile'
# Added by the canvas-lms setup script
# These settings make chruby work
# See https://github.com/postmodern/chruby
PATH=$PATH:~/.scripts/
PATH=$PATH:~/usr/local/bin
# PATH=$PATH:~/.composer/local/bin/
# PATH=$PATH:~/.composer/local/bin/laravel
PATH=~/.composer/vendor/bin:$PATH
# alias composer = "php /usr/local/bin/composer.phar"
@remyhunt
remyhunt / .bash_profile
Created December 23, 2016 00:53
crispy bash profile
PATH="/Library/Frameworks/Python.framework/Versions/3.4/bin:${PATH}"
PATH="/usr/local/sbin:$PATH"
PATH="/usr/local/Cellar/ruby/2.1.5/lib/ruby/gems/2.1.0/gems:$PATH"
alias frash=". ~/.bash_profile"
export PATH
export PATH=/usr/local/bin:$PATH
#MAKE ME PRETTY
@remyhunt
remyhunt / .vimrc
Created December 23, 2016 00:51
my vimrc file
set nocompatible " Disable vi-compatibility
set t_Co=256
colorscheme xoria256
set guifont=menlo\ for\ powerline:h16
set guioptions-=T " Removes top toolbar
set guioptions-=r " Removes right hand scroll bar
set go-=L " Removes left hand scroll bar
set linespace=15
@remyhunt
remyhunt / flatty.js
Last active March 20, 2020 01:17
flatty
function flatten(arrayArg) {
var result = []
for (var i = 0; i < arrayArg.length; i++){
if(arrayArg[i] instanceof Array)
result = result.concat(flatten(arrayArg[i]))
else
result = result.concat(arrayArg[i])
}
return result
}