Skip to content

Instantly share code, notes, and snippets.

David Martorana themartorana

Block or report user

Report or block themartorana

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@themartorana
themartorana / staged.js
Created Dec 14, 2017
Auto-management of receipts and shipping notifications
View staged.js
function handleStaged() {
Logger.log("Starting...")
handleStagedShipping();
handleStagedReceipts();
Logger.log("Done.")
}
function handleStagedReceipts() {
var getLabel = GmailApp.getUserLabelByName('_Stage/Receipts');
var setLabel = GmailApp.getUserLabelByName('Receipts');
@themartorana
themartorana / fastlyMonthToDateBill.py
Last active Jun 27, 2019
Calculate your month-to-date bill from Fastly with the billing API
View fastlyMonthToDateBill.py
# Requires Python 3
import requests
import locale
from typing import Dict, Tuple, List
from calendar import monthrange
from datetime import datetime
FASTLY_URL = "https://api.fastly.com/stats/usage_by_month?billable_units=true"
@themartorana
themartorana / clock.js
Last active Jun 22, 2016
Make the Archilovers clock on the Inspiration tab sweeping seconds.
View clock.js
// Here You can type your custom JavaScript...// Clock
function clock() {
var clockSeconds = document.getElementById('clock-seconds'),
clockMinutes = document.getElementById('clock-minutes'),
clockHours = document.getElementById('clock-hours');
function getTime() {
requestAnimationFrame(getTime);
@themartorana
themartorana / dogstatsd
Created May 5, 2016
dogstatsd rc.d file
View dogstatsd
#!/bin/sh
# $FreeBSD$
# PROVIDE: dogstatsd
# KEYWORD: shutdown
. /etc/rc.subr
name=dogstatsd
rcvar=${name}_enable
View keybase.md

Keybase proof

I hereby claim:

  • I am themartorana on github.
  • I am davemartorana (https://keybase.io/davemartorana) on keybase.
  • I have a public key ASA6AcWSpUfxXC-hMBcdPNcogPZWtQkG8nsT0184Z9GLNgo

To claim this, I am signing this object:

@themartorana
themartorana / random.cs
Last active Jun 7, 2016 — forked from jakeobrien/gist:5503948
Flyclops Domino! Bone Randomization Code
View random.cs
// for Unity (C#)
public static void Shuffle<T>(this List<T> list)
{
System.Random rnd = new System.Random();
int n = list.Count;
while (n > 1) {
n--;
int k = rnd.Next(n + 1);
T obj = list[k];
list[k] = list[n];
@themartorana
themartorana / card_numbers.js
Created Apr 6, 2015
Flyclops Trello Card Numbers
View card_numbers.js
/* Card Numbers */
// ======================================
//
// DOM Manipulation
//
// ======================================
// Fills in the card numbers on newly created cards
View pushID.go
/**
* Fancy ID generator that creates 20-character string identifiers with the following properties:
*
* 1. They're based on timestamp so that they sort *after* any existing ids.
* 2. They contain 72-bits of random data after the timestamp so that IDs won't collide with other clients' IDs.
* 3. They sort *lexicographically* (so the timestamp is converted to characters that will sort properly).
* 4. They're monotonically increasing. Even if you generate more than one in the same timestamp, the
* latter ones will sort after the former ones. We do this by using the previous random bits
* but "incrementing" them by 1 (only in the case of a timestamp collision).
*/
View gist:70fff16ecc67bee8699e
import datetime
import httplib2
# to see in detail what's going on, uncomment
# httplib2.debuglevel = 4
from apiclient.discovery import build
from oauth2client.client import OAuth2Credentials, OAuth2WebServerFlow
if __name__ == "__main__":
@themartorana
themartorana / mailplane.css
Created Oct 16, 2012 — forked from tgambee/mailplane.css
MailPlane Style Customization CSS
View mailplane.css
/* gmail-refreshest: a custom gmail css by @roycifer */
/* some button styles borrowed from twitter bootstrap */
/* @match mail.google.com */
body, td, input, textarea, select {font-family:"Helvetica Neue",helvetica,arial,sans-serif;}
.w-asV > .nH:last-child {display: none;}
.w-asV > .nH > .no , #gbx1, #gbx2{background-image: -webkit-linear-gradient(top,white,#F7F7F7);}
.w-as1.nr{height:27px;border-radius:3px;}
.gbeti#gb .gbqldr, .gbet#gbqlw .gbqldr, .gbesi#gb .gbqldr, .gbes#gbqlw .gbqldr{max-height:35px;margin-top:3px;}
.gbqfqw{border-radius:3px;}
You can’t perform that action at this time.