This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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."]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 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; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Because I always forget how to do this.. */ | |
@font-face { | |
font-family: "My-Special-Font"; | |
src: url("fonts/mySpecialFont-Regular.ttf") format("truetype"); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
} |