Skip to content

Instantly share code, notes, and snippets.

Avatar

Ronald Martin ronaldsmartin

View GitHub Profile
@ronaldsmartin
ronaldsmartin / test.ts
Created Apr 9, 2020
Promise.all does not rethrow errors
View test.ts
export {};
function f(): Promise<string> {
return new Promise<string>((resolve, reject) => {
reject("reject");
});
}
async function g() {
const results = await Promise.all(
View index.html
<!DOCTYPE html>
<html>
<head>
<title>Barack Obama Carpool Karaoke</title>
</head>
<body>
<div class="content">
<div class="main">
<div id="header">
<h1>Petition for Barack Obama Carpool Karoke</h1>
View index.html
<!DOCTYPE html>
<html>
<head>
<title>Barack Obama Carpool Karaoke</title>
</head>
<body>
<div class="content">
<div class="main">
<div id="header">
<h1>Petition for Barack Obama Carpool Karoke</h1>
View index.html
<!DOCTYPE html>
<html>
<head>
<title>Barack Obama Carpool Karaoke</title>
</head>
<body>
<div class="content">
<div class="main">
<div id="header">
<h1>Petition for Barack Obama Carpool Karoke</h1>
View index.html
<!DOCTYPE html>
<html>
<head>
<title>Barack Obama Carpool Karaoke</title>
</head>
<body>
<div class="content">
<div class="main">
<div id="header">
<h1>Petition for Barack Obama Carpool Karoke</h1>
@ronaldsmartin
ronaldsmartin / APODirectory-iOS.playground
Created Sep 22, 2014
Untested async JSON request/unmarshalling for next version of APO app
View APODirectory-iOS.playground
//
// Directory.swift
// APO-DZ
//
// Created by Ronald Martin on 9/21/14.
// Copyright (c) 2014 Alpha Phi Omega, Delta Zeta Chapter. All rights reserved.
//
import Foundation
@ronaldsmartin
ronaldsmartin / LessonOne.playground
Created Sep 6, 2014
Teaching programming to Daniela using Swift
View LessonOne.playground
// Learning Swift with Daniela #1
/*
* Lesson Plan
* ===========
1. Variables & Constants
2. Types
3. Operators
4. Condtionals & Branching
*/
@ronaldsmartin
ronaldsmartin / Replace.hs
Created Sep 5, 2014
Comparing readability of naive implementations of char/string replacement in various languages
View Replace.hs
--| Replace all instances of oldChar in a string with newChar
replaceChar :: Char -> Char -> String -> String
replaceChar oldChar newChar = map replace
where replace oldChar = newChar
replace = id
-- | Replace all instances of oldString in s with newString.
-- Using length and take make this inefficient. Return to this later.
replaceAll :: String -> String -> String
replaceAll oldString newString s
@ronaldsmartin
ronaldsmartin / GoogleSheetJson.md
Last active Sep 13, 2021
Google Spreadsheet JSON Queries
View GoogleSheetJson.md

SheetAsJSON + Filtering

This is an extension of DJ Adams' excellent SheetAsJSON Google Apps Script, which provides a way to GET a published Google Spreadsheet as a JSON feed. This version allows generic filtering for terms, more specific control over which rows to parse, and correct MIME type for JSONP output.

Minimal Usage

The following parameters are required for the script to work.

https://script.google.com/macros/s/AKfycbzGvKKUIaqsMuCj7-A2YRhR-f7GZjl4kSxSN1YyLkS01_CfiyE/exec?
+ id=<spreadsheet key>
+ sheet=<sheet name on spreadsheet>