Skip to content

Instantly share code, notes, and snippets.

View JayGoldberg's full-sized avatar

Jay Goldberg JayGoldberg

  • Google
  • San Francisco, CA, USA
View GitHub Profile
@sucotronic
sucotronic / gist:5832018
Created June 21, 2013 15:30
know how much memory is eating google chrome
ps aux | grep chrome | grep -v grep | awk '{sum+=$6} END {print "chrome total: " sum/(1024*1024) " GB"}'
@eskriett
eskriett / GoogleMapDownloader.py
Last active June 1, 2025 13:22
A python script to download high resolution Google map images given a longitude, latitude and zoom level.
#!/usr/bin/python
# GoogleMapDownloader.py
# Created by Hayden Eskriett [http://eskriett.com]
#
# A script which when given a longitude, latitude and zoom level downloads a
# high resolution google map
# Find the associated blog post at: http://blog.eskriett.com/2013/07/19/downloading-google-maps/
import urllib
import Image
@leesei
leesei / uri_parser.sh
Last active June 17, 2025 15:18
#bash #uri_parser bash uri parser
#!/bin/bash
#
# URI parsing function
#
# The function creates global variables with the parsed results.
# It returns 0 if parsing was successful or non-zero otherwise.
#
# [schema://][user[:password]@]host[:port][/path][?[arg1=val1]...][#fragment]
#
@leommoore
leommoore / mongodb_mongo_shell.md
Last active October 11, 2017 20:47
MongoDB - Mongo Shell

#MongoDB - Mongo Shell

###Single Task You can run commands in MongoDB from the command prompt by feeding the command into the mongo shell using:

mongo server1/admin --eval "db.runCommand({logRotate:1})"

mongo localhost:30000/admin --eval "db.runCommand({logRotate:1})"

This example will rotate the log file without remaining in the mongo shell. Note: admin refers to the admin database. Executing the command returns:

// ***************************************************************************
// * usng.js (U.S. National Grid functions)
// * Module to calculate National Grid Coordinates
// *
// * last changes or bug fixes: February 2009, minor bug fix June 2013
// ****************************************************************************/
//
// Copyright (c) 2009 Larry Moore, [email protected]
// Released under the MIT License; see
// http://www.opensource.org/licenses/mit-license.php
@mufumbo
mufumbo / gist:8547036
Created January 21, 2014 19:49
An extension over google's servingUrl "cdn" features: https://developers.google.com/appengine/docs/java/images/ It links to the Media datastore object and also provides rectangular cropping.
/**
* An extension over google's servingUrl "cdn" features: https://developers.google.com/appengine/docs/java/images/
*
* It links to the Media datastore object and also provides rectangular cropping.
*
* Examples:
* /c/i/69589306
* /c/i/69589306=s300
* /c/i/69589306=s300-c
* /c/i/69589306=s300-c=h20
@daichan4649
daichan4649 / convertSheet2Json.gs
Last active November 16, 2024 12:45
[GAS] load SpreadSheet as JSON #spreadsheet #calendar #google
function convertSheet2Json(sheet) {
// first line(title)
var firstRange = sheet.getRange(1, 1, 1, sheet.getLastColumn());
var firstRowValues = firstRange.getValues();
var titleColumns = firstRowValues[0];
// after the second line(data)
var lastRow = sheet.getLastRow();
var rowValues = [];
for(var rowIndex=2; rowIndex<=lastRow; rowIndex++) {
@olls
olls / notepad.html
Last active May 10, 2024 11:24
A JavaScript notepad with open, save, local storage and markdown preview.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>NotePad!</title>
@cjbarber
cjbarber / unreplied.md
Last active December 23, 2022 14:58
RFS: Gmail Unreplied Messages

A Request for a Startup: Gmail 'Waiting For Reply' Tab

Problem:

  • I, Chris Barber, send many emails. I'd like to get more replies.

Solution:

  • A Chrome extension that adds a 'waiting for' tab to gmail.
function label_awaiting_reply() {
var emailAddress = Session.getEffectiveUser().getEmail();
Logger.log(emailAddress);
var EMAIL_REGEX = /[a-zA-Z0-9\._\-]+@[a-zA-Z0-9\.\-]+\.[a-z\.A-Z]+/g;
var label = GmailApp.createLabel("AwaitingReply");
var d = new Date();
d.setDate(d.getDate() - 7);
var dateString = d.getFullYear() + "/" + (d.getMonth() + 1) + "/" + d.getDate();
threads = GmailApp.search("in:Sent after:" + dateString);
for (var i = 0; i < threads.length; i++)