Skip to content

Instantly share code, notes, and snippets.

View baygross's full-sized avatar
🏠
Working from home

Bay Gross baygross

🏠
Working from home
View GitHub Profile
@baygross
baygross / gd_set_dimensions.js
Created November 24, 2018 19:22
Google Docs - Custom Page Height
/* Set arbitary dimensions for any google doc. Useful for avoiding the soft-page-break dotted line and table breaks */
function myFunction(){
var doc = DocumentApp.openByUrl("YOUR-DOC-URL-GOES-HERE");
var body = doc.getBody();
var pointsInInch = 72;
body.setPageHeight(40 * pointsInInch); // 11 default
body.setPageWidth(8.5 * pointsInInch); // 8.5 default
}
@baygross
baygross / GoogleSheetsBDFunc.js
Created January 10, 2018 17:55
Google Sheets - App Script Code to Extend BD functions (Sensitivity Table) and (TraceDependents)
function run_sensitivity() {
var sheet = SpreadsheetApp.getActiveSpreadsheet();
// set up
var xVar = sheet.getRangeByName("xVar").getValue();
var xMin = sheet.getRangeByName("xMin").getValue();
var xMax = sheet.getRangeByName("xMax").getValue();
var xStep = sheet.getRangeByName("xStep").getValue();
function run_sensitivity() {
var sheet = SpreadsheetApp.getActiveSpreadsheet();
// set up
var xVar = sheet.getRangeByName("xVar").getValue();
var xMin = sheet.getRangeByName("xMin").getValue();
var xMax = sheet.getRangeByName("xMax").getValue();
var xStep = sheet.getRangeByName("xStep").getValue();
@baygross
baygross / Manhattan Geocoded Boundary
Last active May 22, 2019 10:29
The default 'maps' package for R contains bounded polygons defining various regions around the world. One such region is Manhattan, although in this instance the polygon points are shifted off of the island's true location by a significant degree. In some use-cases, this discrepancy may prove unacceptable. Actual bounding coordinates for Manhatt…
lat long
40.700292, -74.010773
40.707580, -73.999271
40.710443, -73.978758
40.721762, -73.971977
40.729568, -73.971291
40.733503, -73.973994
40.746834, -73.968072
40.775114, -73.941936
40.778884, -73.942580
@baygross
baygross / Gemfile
Created March 31, 2012 19:56
Easy Koala (FB) integration with Rails 3
#
# don't forget to run bundle install :)
#
gem 'koala'
@baygross
baygross / Gemfile
Created March 17, 2012 04:17
Yale CAS + LDAP integration with Rails
#
## Add these gems to your Gemfile, and be sure to 'bundle install'
#
gem 'net-ldap'
gem 'rubycas-client'
@baygross
baygross / Gemfile
Created March 12, 2012 07:44
Host a simple static site on heroku with Rack!
source 'http://rubygems.org'
gem 'sinatra'
@baygross
baygross / gist:1410668
Created November 30, 2011 20:25
HackYale Common Terminal Commands
#### Key Terminal Commands #####
# CHECK GIT STATUS
git status
# PULL UPDATES FROM GITHUB
git pull
# STAGE AND COMMIT CHANGES