This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Load a menu item called "Project Admin" with a submenu item called "Send Status" | |
// Running this, sends the currently open sheet, as a PDF attachment | |
function onOpen() { | |
SpreadsheetApp.getActiveSpreadsheet().addMenu('Send sheet', [ | |
{name: 'As email', functionName: 'send'} | |
]); | |
} | |
function getSheetAs(sheet, format) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<head> | |
<style> | |
html, body { | |
width: 100%; height: 100%; margin: 0; padding: 0; | |
background: black url('grace-hopper-fullstack-hiring-day-clean.webp'); | |
background-size: contain; | |
background-position: center center; | |
background-repeat: no-repeat; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const React = require('react') | |
const List = ({ | |
items, | |
Item = Todo.Item // Components recieve any components they depend on via props. | |
// The default assignment keeps our public interface clean. | |
}) => <ul>{items.map((item, index) => <Item key={index}>{item}</Item>)}</ul> | |
const Item = ({ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* I like annotating my functions with comments that contain type annotations. | |
* The annotation syntax I use is, obviously, not an actual language, but it's | |
* strict enough to be one. Perhaps some day I'll write a yet another type flow tool | |
* to check these things! | |
* | |
* The syntax is a mishmash of Swift and JS destructuring expressions. | |
**/ | |
/***** Basic format *****/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function lazy(promise) { | |
return new Proxy(lazy, { | |
get(target, prop, receiver) { | |
if (prop === lazy.promise) { return promise } | |
if (prop === 'catch' || prop === 'then') { | |
return ((...args) => promise[prop].apply(promise, args)) | |
} | |
return lazy(promise.then(x => x[prop])) | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<head> | |
<title>Sudoku solver</title> | |
<style> | |
td { | |
border: 1px solid black; | |
margin: 0; | |
padding: 5px; | |
text-align: center; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html ng-app=WeatherApp> | |
<head> | |
<title>You could just go outside</title> | |
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.5/angular.min.js"></script> | |
<script src="angular-factory-demo.js"></script> | |
</head> | |
<body ng-controller=CurrentWeatherCtrl> | |
<h1>The current temperature is {{ forecast.currently.apparentTemperature }}</h1> | |
<p>At {{ address }} ({{ forecast.latitude }}lat, {{ forecast.longitude }}lng)</p> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use strict" | |
// Create an HTTP server that always serves a couple | |
// of script tags. | |
var http = require('http') | |
var httpServer = http.createServer(function(req, rsp) { | |
rsp.end(` | |
<script src="/socket.io/socket.io.js"></script> | |
<script> | |
// This JS is running on the client. Whee! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<head> | |
<link rel=stylesheet href=style.css> | |
</head> | |
<body> | |
<h1 id=header>trip planner</h1> | |
<ul class=todo-list> | |
<li class=todo-list-new-item> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
INSERT INTO Users (name, pictureUrl) VALUES ('Donald Trump', 'http://i.imgur.com/CTil4ns.jpg'); | |
INSERT INTO Users (name, pictureUrl) VALUES ('Ted Cruz', 'http://i.imgur.com/Ru6KUIm.jpg'); | |
INSERT INTO Users (name, pictureUrl) VALUES ('Bernie Sanders', 'http://i.imgur.com/KhisgEO.jpg'); | |
INSERT INTO Users (name, pictureUrl) VALUES ('Hillary Clinton', 'http://i.imgur.com/XbsjDcr.jpg'); | |
INSERT INTO Users (name, pictureUrl) VALUES ('Marco Rubio', 'http://i.imgur.com/cYxVyyg.jpg'); | |
INSERT INTO Users (name, pictureUrl) VALUES ('John Kasich', 'http://i.imgur.com/I8WtzSw.jpg'); | |
INSERT INTO Users (name, pictureUrl) VALUES ('Kanye West', 'http://i.imgur.com/MItGWVS.jpg'); | |
INSERT INTO Users (name, pictureUrl) VALUES ('Taylor Swift', 'http://i.imgur.com/JKInSVz.jpg'); | |
INSERT INTO Tweets (userId, content) VALUES ((SELECT id from Users where name='Donald Trump'), 'Make Fullstack great again!'); |