Skip to content

Instantly share code, notes, and snippets.

function cleanUp() {
var threads = GmailApp.search('label:inbox label:.weekly older_than:7d');
for (var i = 0; i < threads.length; i++) {
threads[i].moveToArchive();
}
}
@edbury
edbury / 0_reuse_code.js
Created October 5, 2015 21:06
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
### Keybase proof
I hereby claim:
* I am edbury on github.
* I am edbury (https://keybase.io/edbury) on keybase.
* I have a public key whose fingerprint is C20D 0417 A87F 0109 7B52 CBFB D8CC 78E2 8879 219F
To claim this, I am signing this object:
# Configs
config defaultToCurrentScreen true
config nudgePercentOf screenSize
config resizePercentOf screenSize
config secondsBetweenRepeat 0.1
config checkDefaultsOnLoad true
config focusCheckWidthMax 3000
# Hyper Alias
alias hyper ctrl;shift;alt;cmd
@edbury
edbury / setup.php
Last active December 16, 2015 17:29
WP Alchemy "populating from wrong post" bugged code.
$speaker_mb = new WPAlchemy_MetaBox(array
(
'id' => '_speaker_meta',
'title' => 'Speaker Information',
'types' => array('speaker'),
'context' => 'normal',
'priority' => 'high',
'prefix' => 'speaker_',
'mode' => WPALCHEMY_MODE_EXTRACT,
'template' => WP_PLUGIN_DIR . '/moxie-events-network/metaboxes/speaker-meta.php'
<?php
/*
Title: Company Information
Description: My cool new meta box
Post Type: company
Context: normal
Priority: high
Order: 1
Collapse: false
*/
@edbury
edbury / twitter.php
Created November 1, 2012 20:03
WordPress to Twitter via Matt Harris' tmhOAuth
/**
* Tweets a message from the user whose user token and secret you use.
*
* Although this example uses your user token/secret, you can use
* the user token/secret of any user who has authorised your application.
*
* Instructions:
* 1) If you don't have one already, create a Twitter application on
* https://dev.twitter.com/apps
* 2) From the application details page copy the consumer key and consumer
@edbury
edbury / djstats.js
Created September 19, 2012 05:38
cmbot :: dj session stats
/*
* Module: djstats
* A work in progress.
*/
var djstats = {};
djstats.points = [];
djstats.yoinks = [];
var customEvents = [
/*{