Skip to content

Instantly share code, notes, and snippets.

/^([\\(+. ]*64[\\)-. ]*|[+ ]*|[+-. ]*)/
^([\\(+. ]*64[\\)-. ]*|[+ ]*|[+-. ]*)
@heymatthew
heymatthew / batch-delete-gmail-emails.js
Last active August 14, 2023 19:55 — forked from gene1wood/batch-delete-gmail-emails.js
A Google Apps Script script to bulk delete large amounts of email in Gmail while avoiding the error #793 which Gmail encounters normally
// This script, when used with Google Apps Scripts will delete 500 emails and can be triggered to run every minute without user interaction enabling you to bulk delete email in Gmail without getting the #793 error from Gmail.
// Configure the search query in the code below to match the type of emails you want to delete
// Browser to https://script.google.com/.
// Start a script and paste in the code below.
// After you past it in, save it and click the little clock looking button. This is for your triggers. You can set up how frequently you want the script to run (I did mine for every minute).
// Source : # https://productforums.google.com/d/msg/gmail/YeQVDuPIQzA/kpZPDDj8TXkJ
function batchDeleteEmail() {
var batchSize = 100 // Process up to 100 threads at once
@heymatthew
heymatthew / Caddyfile
Last active August 4, 2019 19:23
Docker for CoNZealand
members.conzealand.nz {
log stdout
errors stdout
proxy / members_production:3000 {
transparent
}
}
members-staging.conzealand.nz {
log stdout
@heymatthew
heymatthew / so-many-promises.js
Created August 20, 2012 21:07
Chaining Promises with JQuery in Javascript
// Prereq: underscore.js and jquery loaded
var p1 = $.Deferred();
var p2 = $.Deferred();
// We want something that chains promises, so something like...
//p1.done(
// function addNext() {
// p2.done(
// function addNext() {
@heymatthew
heymatthew / server.go
Created March 20, 2018 06:44
WIP Counter Webserver
package main
import (
"fmt"
"image"
_ "image/png"
"net/http"
"os"
"regexp"
"sync"
@heymatthew
heymatthew / gpg_folder.rb
Created June 3, 2017 03:26
Script to quickly encrypt or decrypt whole directories
#!/usr/bin/env ruby
# gpg_folder - Script to quickly tar, compress and encrypt directories
# Copyright (C) 2017 Matthew B. Gray
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
@heymatthew
heymatthew / latest_ruby.rb
Created November 20, 2016 18:44
Quickly find if you're running the latest rbenv
#!/usr/bin/env ruby
def get_lines(output)
output.lines.map(&:chomp).map(&:strip)
end
available = get_lines(`rbenv install -l`).select { |v| v.match(/^[\d\.]+$/) }
installed = get_lines(`rbenv versions`)
puts
@heymatthew
heymatthew / .vimrc
Last active December 27, 2015 01:19
vimrc
" .vimrc configuration file
" Copyright (C) 2013 Matthew B. Gray
"
" Permission is granted to copy, distribute and/or modify this document
" under the terms of the GNU Free Documentation License, Version 1.3
" or any later version published by the Free Software Foundation;
" with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
" A copy of the license is included in the section entitled "GNU
" Free Documentation License".
To get Git to diff between your odt/odp/ods files you will need to do the following things:
Install a conversion tool
$ sudo yum install odt2txt
Create your git config info directory if it's not already there
$ mkdir -p ~/.config/git/info
Add in attributes (you can paste this straight in or edit the file accordingly)
$ cat > ~/.config/git/info/attributes <<DELIM