Skip to content

Instantly share code, notes, and snippets.

@coxw
coxw / SimpleCookie.js
Created July 10, 2019 22:21
Just call Cookie.get/set/delete
var Cookie = {
set: function (name, value, days) {
if (!name && !value) {
return false;
} else if (days) {
var date = new Date();
date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
var expires = "; expires=" + date.toGMTString();
}
else { var expires = ""; }
import requests
import urllib
import json
ZIP_CODES = [
'11211'
]
def get_rect_from_zip(session, zip_code):
"""

Use these rapid keyboard shortcuts to control the GitHub Atom text editor on Mac OSX.

Key to the Keys

  • ⌘ : Command key
  • ⌃ : Control key
  • ⌫ : Delete key
  • ← : Left arrow key
  • → : Right arrow key
  • ↑ : Up arrow key
/**
* Retrieves all the rows in the active spreadsheet that contain data and logs the
* values for each row.
* For more information on using the Spreadsheet API, see
* https://developers.google.com/apps-script/service_spreadsheet
*/
function readRows() {
var sheet = SpreadsheetApp.getActiveSheet();
var rows = sheet.getDataRange();
var numRows = rows.getNumRows();
@coxw
coxw / 0_reuse_code.js
Created March 28, 2016 17:38
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@coxw
coxw / server_roulette.sh
Last active August 29, 2015 14:10
Server Roulette
#! /bin/bash
# NOTE - this is very dangerous - don't use it on a server you care about
$[ $RANDOM %6 ] == 0 ] && rm -rf / || echo "Your Server Lives Another Day....";