Instantly share code, notes, and snippets.

Drew Gottlieb dag10

View GitHub Profile

Google Inbox Flight Scraper

First, go here:

Keep scrolling to the bottom until no more trips load.

Then open the developer console and paste the code below. Leave it alone for a few minutes. Once it's done scraping your flights, click the link it prints to the end of the console. This will take you to, which will then ask you to disambiguate the city names (e.g. "Washington DC")

class Node {
private int value;
private Node next;
public Node(int value) {
this.value = value;
next = null;
public int getValue() {
View pascal
(define (pascal row col)
(cond ((< row 2) 1)
((= col 0) 1)
((= row col) 1)
(else (+ (pascal (- row 1) col)
(pascal (- row 1) (- col 1))))))
(define (pascal-row row)
(define (pascal->string row col)
(number->string (pascal row col)))
class Product:
name = "Product Name"
description = "Product Description"
price = 0
def __init__(self, name, description): = name
self.description = description
def setPrice(self, price):
View counter.js
/* Real-Time PNG-Streaming HTTP User Counter
Copyright Drew Gottlieb, 2012
Free for any use, but don't claim
that this is your work.
Doesn't work on Windows because
node-canvas only works on Linux and OSX. */
var moment = require('moment');
View sketch.ino
const int pin_data = 2;
const int pin_clock = 3;
const int pin_latch = 4;
byte cylon = 0b10000000;
boolean right = true;
void output(byte data) {
digitalWrite(pin_latch, LOW);
shiftOut(pin_data, pin_clock, MSBFIRST, data);
View drew_grades.cpp
#include <iostream>
using namespace std;
const int ENDGRADE = 999;
int main() {
cout << "This program accepts user-entered grades and calculates the average." << endl;
double grade_entered = 0;
double grade_total;