Skip to content

Instantly share code, notes, and snippets.

View RobertLowe's full-sized avatar

Robert Lowe RobertLowe

View GitHub Profile
@RobertLowe
RobertLowe / anti-newsletters.gs
Last active January 8, 2022 18:49
Anti Newsletter Script for Gmail (and Archive)
function processInbox() {
var label = GmailApp.getUserLabelByName("Newsletter");
if(!label){
label = GmailApp.createLabel("Newsletter");
}
// process all recent threads in the Inbox
var threads = GmailApp.search("newer_than:2d -minusimportantthings");
for (var i = 0; i < threads.length; i++) {
// get all messages in a given thread
var messages = threads[i].getMessages();

Keybase proof

I hereby claim:

  • I am RobertLowe on github.
  • I am robertlowe (https://keybase.io/robertlowe) on keybase.
  • I have a public key whose fingerprint is 8872 8828 D334 6AAE F5B0 C12E 3DB6 A5D8 889C D40E

To claim this, I am signing this object:

@RobertLowe
RobertLowe / list.txt
Created September 27, 2018 05:38
twitch.tv all non-automated tags
100%
3D Modeling
3D Printing
Achievement Hunting
Action
Adventure
Adventure Game
All pick
AMA
Animals
@RobertLowe
RobertLowe / README.md
Last active April 6, 2018 21:50
forceFinderBoundsAndPosition.scpt

Force Finder Bounds and Position - Stay boy stay!

Create files below and and load:

launchctl load ~/Library/LaunchAgents/com.you.forceFinder.plist

Enjoy Finder windows with a static position and size! Adjust to your personal preferences.

Stay in place finder

@RobertLowe
RobertLowe / resolving.js
Created March 14, 2018 03:29
Stop using async with Meteor. Futures are the future (still).
// Go forth and code with the simplicity of sync
//
// PSA: this isn't production ready, and just a PoC, but enjoy using it!
// server only, as we need fibers (co-routines)!
import Future from 'fibers/future';
let resolving = (object, operation, ...args)=>{
let future = new Future();
@RobertLowe
RobertLowe / mango.md
Created March 9, 2018 14:46
Meteor <-> Mongo, positional operator caution

This is poor behaviour from Mongo, and sorta fixed in 3.6 via the $[] operator (which is coming in Meteor 1.6.2), you should verify your apps aren't effected

But, $ probably isn't working as expected (in some cases)

$ | Acts as a placeholder to update the first element that matches the query condition.

https://docs.mongodb.com/manual/reference/operator/update-array/#update-operators

Docs are correct, but consider this example:

@RobertLowe
RobertLowe / json
Last active January 6, 2018 23:15
IBM EoD 2014->2016
[ {
"date": "2014-01-02T14:30:00.000Z",
"open": 187.2100067138672,
"low": 185.1999969482422,
"high": 187.39999389648438,
"close": 185.52999877929688,
"volume": 4546500
}, {
"date": "2014-01-03T14:30:00.000Z",
"open": 185.8300018310547,
@RobertLowe
RobertLowe / ubuntu-12.04-lts.erb.sh
Created April 26, 2012 20:31
chef ubuntu 12.04 LTS bootstrap
bash -c '
if [ ! -f /usr/bin/chef-client ]; then
apt-get update
apt-get -y upgrade
apt-get install -y build-essential wget zlib1g-dev libssl-dev libffi-dev libncurses-dev libreadline-dev libyaml-dev libffi6 libssl0.9.8
wget https://s3.amazonaws.com/dev.ops/ruby-1.9.3-p194-perf_without_psych_no_warnings_amd64.deb
dpkg -i ruby-1.9.3-p194-perf_without_psych_no_warnings_amd64.deb
wget http://production.cf.rubygems.org/rubygems/rubygems-1.8.23.tgz
@RobertLowe
RobertLowe / yaml.rb.diff
Created April 26, 2012 19:41
No, you shutta-upa
diff a/lib/yaml.rb b/lib/yaml.rb
--- a/lib/yaml.rb
+++ b/lib/yaml.rb
@@ -57,9 +58,6 @@
require 'psych'
engine = 'psych'
rescue LoadError
- warn "#{caller[0]}:"
- warn "It seems your ruby installation is missing psych (for YAML output)."
- warn "To eliminate this warning, please install libyaml and reinstall your ruby."
@RobertLowe
RobertLowe / gist:2065750
Created March 17, 2012 22:08
Load a Chef::Node and convert it to an actual Node object
# load a chef node and turn it into an actual node object
node = Chef::Node.load("xxxx") # returns a hash
node = Chef::Node.new.tap do |n|
n.name( node["name"] )
n.chef_environment( node["chef_environment"] )
n.run_list( node["run_list"])
n.normal_attrs = node["normal"]
n.default_attrs = node["default"]