Skip to content

Instantly share code, notes, and snippets.

View mrchrisadams's full-sized avatar

Chris Adams mrchrisadams

View GitHub Profile
#!/bin/bash
# These functions expect CLOUD_PLATFORM to be bound to one of the values below.
# Read in if this is a specific cloud.
# cloud_platform options:
# AWS
# AZURE
# GCE
# ORACLE
{
"privacyStatement": "https://example.org/privacy.html",
"countriesDataHeld": ["IE", "LU"],
"portability": {
"description": "You can download your raw account data",
"url": "https://example.org/give-me-my-data.html"
},
"deletion": {
"description": "To delete your data, you must contact our support team",
"url": "mailto:support@example.org"
@rooreynolds
rooreynolds / CountEmail.gs
Last active June 2, 2022 20:09
Gmail email stats (Google Sheets script)
function CountEmail() {
var starredEmails = GmailApp.search('is:starred');
var newunreadEmails = GmailApp.search('is:unread label:inbox');
var urgentEmails = GmailApp.search('label:urgent');
var waitingEmails = GmailApp.search('label:waiting-for');
var chaseEmails = GmailApp.search('label:chase');
var draftEmails = GmailApp.search('in:draft');
var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Sheet1");
@zkat
zkat / index.js
Last active July 8, 2024 04:39
npx is cool
#!/usr/bin/env node
console.log('yay gist')
@simonw
simonw / wget.md
Created December 9, 2016 06:38
Recursive wget ignoring robots
$ wget -e robots=off -r -np 'http://example.com/folder/'
  • -e robots=off causes it to ignore robots.txt for that domain
  • -r makes it recursive
  • -np = no parents, so it doesn't follow links up to the parent folder
@wrightmartin
wrightmartin / gist:ca9ed23b32a05f98114d
Created June 10, 2015 14:50
How I test long names now
Daenerys Stormborn of the House Targaryen, the First of Her Name, the Unburnt, Queen of Meereen, Queen of the Andals and the Rhoynar and the First Men, Khaleesi of the Great Grass Sea, Breaker of Chains, and Mother of Dragons.
@maban
maban / Event Notes.md
Last active March 9, 2020 19:28
Event Notes

Event Notes

  • Event Name:
  • Location:
  • Date:
  • Conference format: (number of days, tracks, and speakers)

Talk

@jackiekazil
jackiekazil / rounding_decimals.md
Last active January 17, 2024 12:29
How do I round to 2 decimals in python?

How do I round to 2 decimals?

In python, you have floats and decimals that can be rounded. If you care about the accuracy of rounding, use decimal type. If you use floats, you will have issues with accuracy.

All the examples use demical types, except for the original value, which is automatically casted as a float.

To set the context of what we are working with, let's start with an original value.

Original Value