Skip to content

Instantly share code, notes, and snippets.

{
"global": {
"check_for_updates_on_startup": true,
"show_in_menu_bar": true,
"show_profile_name_in_menu_bar": false
},
"profiles": [
{
"complex_modifications": {
"parameters": {
#!/bin/python
import sys, getopt, os
import csv
def main(argv):
inputfile = ''
outputfile = ''
# Get the current working
@avishaan
avishaan / enfile-limit-fix-meteor.sh
Created October 24, 2017 19:27
Fix meteor enfile issue on mac "Error: ENFILE: file table overflow, scandir '/Users/ronaldo.pontes/code/rea..."
#!/bin/bash
sudo -v
echo kern.maxfiles=65536 | sudo tee -a /etc/sysctl.conf
echo kern.maxfilesperproc=65536 | sudo tee -a /etc/sysctl.conf
sudo sysctl -w kern.maxfiles=65536
sudo sysctl -w kern.maxfilesperproc=65536
ulimit -n 65536 65536
echo "add 'ulimit -n 65536 65536' to your .bashrc or .zshrc file"
echo "restart shell"
@avishaan
avishaan / add-reading-list-from-chrome.scpt
Created July 30, 2017 01:15
Love using Chrome but miss being able to add the current page to your 'reading list' in Safari, run this script
-- 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)
@avishaan
avishaan / image-resize.js
Created December 31, 2016 03:25
adjust image size
// 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++) {
@avishaan
avishaan / swapfile.h
Last active January 6, 2017 06:55
Create swapfile on
#!/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
@avishaan
avishaan / jsdoc.js
Created October 13, 2016 04:32
"complex" jsdoc example
/**
* 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
@avishaan
avishaan / .vimrc
Last active July 21, 2016 12:50
My .vimrc that everyone has been asking for
" 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
@avishaan
avishaan / dataFormatExamples.js
Last active July 11, 2016 01:43
Dashboard MongoDB object format
// 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
@avishaan
avishaan / .tern-project
Created August 12, 2015 21:43
TernJS MeteorJS general config file
{
"libs": [
"browser",
"jquery",
"underscore"
],
"loadEagerly": [
"*.js", "*/*.js", "*/*/*.js", "*/*/*/*.js"
],
"dontLoad": [