Skip to content

Instantly share code, notes, and snippets.

View dreeves's full-sized avatar

Daniel Reeves dreeves

View GitHub Profile
@dreeves
dreeves / bid.js
Created March 21, 2023 19:11
Business logic for the /bid command
// BOTILS -- bot utilities
// Bernoulli trial with probability p
var bern = function(p) { return (Math.random() < p) }
// Respond with string txt to everyone in the channel, echoing the slash command
var shout = function(res, txt) {
res.send({ "response_type": "in_channel", "text": txt })
}
@dreeves
dreeves / keybase.txt
Created August 16, 2016 06:13
Keybase proof
### Keybase proof
I hereby claim:
* I am dreeves on github.
* I am dreeves (https://keybase.io/dreeves) on keybase.
* I have a public key whose fingerprint is E830 879C 7F34 2BFF 859E 2613 D6CF 0DF8 32EE 3BAF
To claim this, I am signing this object:
#!/usr/bin/env php
<?php
$path = '/Users/dreeves/prj/beeminder-php-api';
$usr = 'test1602';
$key = 'gpNE1uWHVLq2Erbn4cCH';
$slug = 'test';
function roadtighten($api, $goal) {
$road = $goal->roadall;
@dreeves
dreeves / snooze.js
Created September 8, 2012 00:54
Email Snooze
/* EMAIL SNOOZE
Inspired by: http://lifehacker.com/5825634/how-to-add-a-snooze-button-to-gmail
and http://messymatters.com/email
Docs: https://developers.google.com/apps-script/service_docslist
Initial Setup Instructions:
Create a new google docs spreadsheet (sic) and then select
Tools > Script Editor
and paste in this code.