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 couple alias to switch iterm window from dark to light | |
alias itermlight='echo -e "\033]50;SetProfile=light\a"' | |
alias itermdark='echo -e "\033]50;SetProfile=dark\a"' |
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
describe("A calculator", function() { | |
it("should square correctly", function() { | |
[ | |
{ number: 2, answer: 4}, | |
{ number: 3, answer: 9}, | |
{ number: 4, answer: 16} | |
].forEach(function(problem, index, array){ | |
// we will pretend to calculate with our fnc here | |
var calcAnswer = problem.number*problem.number; | |
expect(calcAnswer).toEqual(problem.answer); |
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
describe("A calculator", function() { | |
it("should square correctly", function(done) { | |
[ | |
{ number: 2, answer: 4}, | |
{ number: 3, answer: 9}, | |
{ number: 4, answer: 16} | |
].forEach(function(problem, index, array){ | |
// we will pretend to calculate with our fnc here | |
setTimeout(function(){ | |
var calcAnswer = problem.number*problem.number; |
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
{ | |
"libs": [ | |
"browser", | |
"jquery", | |
"underscore" | |
], | |
"loadEagerly": [ | |
"*.js", "*/*.js", "*/*/*.js", "*/*/*/*.js" | |
], | |
"dontLoad": [ |
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
// basic json document template | |
var graphBaseTemplate = { | |
'_id': '0012938801abfe', //auto assigned by database | |
'kHospitalName': 'kKaiser', | |
'kHospitalId': '0012938801abf1', | |
'kGraphName': 'kCostSavings', | |
'kGraphId': '0012938801abf2', | |
'kDepartmentName': 'kHospitalWide', | |
'kDepartmentId': '0012938801abf3', | |
'datasets': datasets |
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
" https://github.com/Valloric/YouCompleteMe/issues/611 | |
"let $PATH = '/usr/local/opt/python/Frameworks/Python.framework/Versions/2.7/lib/libpython2.7.dylib -DPYTHON_INCLUDE_DIR=/usr/local/opt/python/Frameworks/Python.framework/Versions/2.7'.$PATH | |
let $PATH = '/usr/local/bin:'.$PATH | |
set nocompatible " be iMproved, required | |
filetype off " required | |
" set the runtime path to include Vundle and initialize | |
set rtp+=~/.vim/bundle/Vundle.vim | |
call vundle#begin() | |
" alternatively, pass a path where Vundle should install plugins |
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
/** | |
* sort data | |
* | |
* @param {String[]} data - data points | |
* @param {String[]} labels - labels in same order as data points | |
* @param {Object} options - labels in same order as data points | |
* @param {Number} sort - direction to short (ascending, descending) | |
* @return {Object} sorted - sortedData object | |
* @return {Number[]} sorted.data - data sorted in order | |
* @return {String[]} sorted.labels - labels for data returned in matching order |
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
#!/bin/bash | |
#https://www.digitalocean.com/community/tutorials/how-to-add-swap-space-on-ubuntu-16-04 | |
sudo fallocate -l 2G /swapfile | |
ls -lh /swapfile | |
chmod 0600 /swapfile | |
sudo mkswap /swapfile |
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
// Call this function *after* the page is completely loaded! | |
function resize_images(maxht, maxwt, minht, minwt) { | |
var imgs = document.getElementsByTagName('img'); | |
var resize_image = function(img, newht, newwt) { | |
img.height = newht; | |
img.width = newwt; | |
}; | |
for (var i = 0; i < imgs.length; i++) { |
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
-- Script will open Chrome, put url of active view onto clipboard, open Safari, add to reading list, wait for abit while added to reading list | |
tell application "Google Chrome" | |
activate | |
set the clipboard to (URL of active tab of first window as text) | |
end tell | |
tell application "Safari" | |
activate | |
add reading list item (get the clipboard) |
OlderNewer