Skip to content

Instantly share code, notes, and snippets.

View superstrong's full-sized avatar

Robbie Mitchell superstrong

View GitHub Profile
@superstrong
superstrong / breadcrumb-gmail-filter.xml
Last active December 27, 2015 00:59
This Gmail filter is intended to help you remember notes, milestones, and feedback-related items, whether positive or negative, for later reference. HOW IT WORKS: Send yourself a new email or forward an existing thread to yourself; use the words "breadcrumb for {name}" in your new message, where name is the person the note is about. The filter w…
<?xml version='1.0' encoding='UTF-8'?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:apps='http://schemas.google.com/apps/2006'>
<title>Mail Filters</title>
<updated>2013-10-30T19:29:02Z</updated>
<author>
<name>Robbie Mitchell</name>
<email>robbie@knewton.com</email>
</author>
<entry>
<category term='filter'></category>
<title>general filter</title>
#!/bin/bash
# Set the ROOM_ID & AUTH_TOKEN variables below.
# Further instructions at https://www.hipchat.com/docs/apiv2/auth
ROOM_ID=XXX
AUTH_TOKEN=XXX
MESSAGE="Hello world!"
curl -H "Content-Type: application/json" \
/* 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;}
.w-asV.aiw{height:60px;}
.gbeti#gb .gbqldr, .gbet#gbqlw .gbqldr, .gbesi#gb .gbqldr, .gbes#gbqlw .gbqldr{max-height:35px;margin-top:3px;}

Keybase proof

I hereby claim:

  • I am superstrong on github.
  • I am robbiemitchell (https://keybase.io/robbiemitchell) on keybase.
  • I have a public key whose fingerprint is 41B4 49F8 E294 3828 97D1 00F5 2EBA 8CA9 30C1 E063

To claim this, I am signing this object:

@superstrong
superstrong / logCurrentApp
Created April 3, 2014 16:17
[Applescript] Every 10 seconds, append the current dateTime, name of the current application, and window title to a file called "activeApps.csv" on the desktop. To use, export as an application and check "Stay open after run handler", then give the application access to Assistive Devices. TODO: change delimiter so commas in window titles don't c…
delay (2)
idle {}
on idle
my checkApp()
return 9
end idle
on checkApp()
global frontApp, frontAppName, windowTitle
@superstrong
superstrong / gmail-permalink
Created April 3, 2014 17:31
[Browser bookmarklet] To generate a permalink to a Gmail message: (1) Open the email (2) Click "Show original (3) Run bookmarklet. You can share the search query (useful for when either party is logged into more than one Gmail account) or share the browser URL. Source: http://stackoverflow.com/questions/16827485/using-gmail-message-source-genera…
@superstrong
superstrong / knewton_hubspot_redirection
Created August 26, 2014 18:30
Knewton HubSpot Redirection Page with Spinner
<html>
<head>
<title>{{ content.html_title }}</title>
<meta name="description" content="{{ content.meta_description }}"/>
<meta name="robots" content="noindex">
<style>
.spinner {
position: fixed;
top: 50%;
left: 50%;
@superstrong
superstrong / zip_code_exploder.gs
Last active June 29, 2017 17:14
A Google Script that transforms a zip code into city, state zip via zippopotam.us
// Example use in a cell: "=map(90210)" (without quotes)
// Example output: "Beverly Hills, CA 90210"
function map(zip_code) {
// Make HTTP Request
var url = 'http://api.zippopotam.us/us/' + zip_code;
var response = UrlFetchApp.fetch(url);
var json = response.getContentText();
var data = JSON.parse(json);
@superstrong
superstrong / segment-identify-no-db
Last active March 9, 2016 00:43
Segment db-less identify
This code is for a website that collects email addresses but no registrations (e.g., passwords, etc.). The requirements for the project go further, but this is a necessary first step.
Project requirements:
- Simplify tracking implementation
- Use a userId, not email address, as primary key
- Avoid using a database on email-only website
Segment is useful as a canonical tracker -- a single place to track identity, pageviews. It works best, though, when a server generates a userId and calls `identify`, ensuring the userId passed through to all connected services.
Here, in lieu of a server-generated userId, we check for a Segment userId in the cookie. If it exists, we use it. If it doesn't, we grab Segment's anonymousId and re-use it as userId. This, along with the other form fields in a simple form, are used in an `identify` call that ensures all connected services get the same userId.
@superstrong
superstrong / mailchimp-ajax-segment
Last active March 11, 2016 03:28
Add proper Segment tracking to your Mailchimp signup form
userId is a better way to join data at the user level across various tracking/email/etc. services. Why?
- UserId is stable (e.g., update a user's email address from anywhere by calling Segment identify with the same userId.)
- UserId is not PII (e.g., Google Analytics explicitly forbids using PII as a userId)
So, in addition to manually adding a subscriber to your Mailchimp list, this will explicitly assign a userId to each new subscriber and identify the user via Segment.
Quick steps:
- Get your Mailchimp list embed code here: Lists -> {list} -> Signup forms -> Embedded forms
- Use it to replace the three values in the "action" line below with your own. Also change "us6" if yours is different.
- In the hidden input field with id "bot-field", replace the name with the one from your own embed code.