Skip to content

Instantly share code, notes, and snippets.

View ronaldsmartin's full-sized avatar

Ronald Martin ronaldsmartin

View GitHub Profile
@ronaldsmartin
ronaldsmartin / test.ts
Created April 9, 2020 18:48
Promise.all does not rethrow errors
export {};
function f(): Promise<string> {
return new Promise<string>((resolve, reject) => {
reject("reject");
});
}
async function g() {
const results = await Promise.all(
<!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>
<!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>
<!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>
<!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 September 22, 2014 03:11
Untested async JSON request/unmarshalling for next version of APO app
//
// 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 September 6, 2014 00:26
Teaching programming to Daniela using Swift
// Learning Swift with Daniela #1
/*
* Lesson Plan
* ===========
1. Variables & Constants
2. Types
3. Operators
4. Condtionals & Branching
*/
@ronaldsmartin
ronaldsmartin / Replace.hs
Created September 5, 2014 09:15
Comparing readability of naive implementations of char/string replacement in various languages
--| 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 December 16, 2023 06:53
Google Spreadsheet JSON Queries

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>