Here are some notes I am keeping on how I set up a development environment on my M1 mac.
softwareupdate --install-rosetta
/* | |
* Async.gs | |
* | |
* Manages asyncronous execution via time-based triggers. | |
* | |
* Note that execution normally takes 30-60s due to scheduling of the trigger. | |
* | |
* @see https://developers.google.com/apps-script/reference/script/clock-trigger-builder.html | |
*/ |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<title>Leaflet - Emoji marker</title> | |
<meta charset="utf-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<link href="https://unpkg.com/leaflet@1.6.0/dist/leaflet.css" rel="stylesheet" integrity="sha512-xwE/Az9zrjBIphAcBb3F6JVqxf46+CDLwfLMHloNu6KEQCAWi6HcDUbeOfBIptF7tcCzusKFjFw2yuvEpDL9wQ==" crossorigin=""/> | |
<script src="https://unpkg.com/leaflet@1.6.0/dist/leaflet.js" integrity="sha512-gZwIG9x3wUXg2hdXF6+rVkLF/0Vi9U8D2Ntg4Ga5I5BZpVkVxlJWbSQtXPSiUTtC0TjtGOmxa1AJPuV0CPthew==" crossorigin=""></script> | |
<style> | |
.mymarker { font-size: 50px; } |
#!/bin/bash | |
# Generate a `:something-intensifies:` Slack emoji, given a reasonable image | |
# input. I recommend grabbing an emoji from https://emojipedia.org/ | |
set -euo pipefail | |
# Number of frames of shaking | |
count=10 | |
# Max pixels to move while shaking |
There are event objects at Google Apps Script. Typically, users which use Spreadsheet often use onEdit(event)
. Here, I would like to introduce the process costs for the event objects using this onEdit(event)
.
When onEdit(event)
is used for the spreadsheet, event
of onEdit(event)
has the following structure.
{
"authMode": {},
# Does NOT implement the PEP 249 spec, but the return type is suggested by the .fetchall function as specified here: https://www.python.org/dev/peps/pep-0249/#fetchall | |
import time | |
import boto3 | |
# query_string: a SQL-like query that Athena will execute | |
# client: an Athena client created with boto3 | |
def fetchall_athena(query_string, client): | |
query_id = client.start_query_execution( | |
QueryString=query_string, |
I got to here after spending hours trying to deploy to an Elastic Beanstalk instance via CircleCi 2.0 so I thought I'd write up what worked for me to hopefully help others. Shout out to RobertoSchneiders who's steps for getting it to work with CircleCi 1.0 were my starting point.
For the record, I'm not the most server-savvy of developers so there may be a better way of doing this.
value | text | |
---|---|---|
Pacific/Midway | (GMT-11:00) Midway | |
Pacific/Niue | (GMT-11:00) Niue | |
Pacific/Pago_Pago | (GMT-11:00) Pago Pago | |
Pacific/Honolulu | (GMT-10:00) Hawaii Time | |
Pacific/Johnston | (GMT-10:00) Johnston | |
Pacific/Rarotonga | (GMT-10:00) Rarotonga | |
Pacific/Tahiti | (GMT-10:00) Tahiti | |
Pacific/Marquesas | (GMT-09:30) Marquesas | |
America/Anchorage | (GMT-09:00) Alaska Time |
'use strict'; | |
exports.handler = (event, context, callback) => { | |
// Get request and request headers | |
const request = event.Records[0].cf.request; | |
const headers = request.headers; | |
// Configure authentication | |
const authUser = 'user'; | |
const authPass = 'pass'; |
The following are examples of the four types rate limiters discussed in the accompanying blog post. In the examples below I've used pseudocode-like Ruby, so if you're unfamiliar with Ruby you should be able to easily translate this approach to other languages. Complete examples in Ruby are also provided later in this gist.
In most cases you'll want all these examples to be classes, but I've used simple functions here to keep the code samples brief.
This uses a basic token bucket algorithm and relies on the fact that Redis scripts execute atomically. No other operations can run between fetching the count and writing the new count.