Skip to content

Instantly share code, notes, and snippets.

@iamstuartwilson
iamstuartwilson / mailto.js
Last active August 29, 2015 14:14
jQuery mailto param scraper
$('a[href^="mailto:"]').click(function(e) {
var uri = $(this).attr('href');
var emailRegEx = new RegExp(/\mailto:(.*?)\?/);
var params = uri.replace(emailRegEx, '').split('&');
var email = uri.match(emailRegEx);
var fields = {
email: email ? email[1] : null,
subject: null,
body: null
@iamstuartwilson
iamstuartwilson / wws.md
Created May 14, 2015 13:14
Working with Strava API

Things to think about

  • Building our own client. strava-v3 is quite good, but I'm not a fan of the interface
  • Making value objects for units of distance and time. How do we hold data centrally to allow users freedom to switch between metric and imperial
  • Isomorphic JS, what can we ship on the front and back?
  • Data crunching. How are we setting up mutliple API requests and queueing them without borking our server or maxing out rate limits?
@iamstuartwilson
iamstuartwilson / great-gifs.md
Last active August 29, 2015 14:21
Great GIFs

U WOT M8

u wot m8

@iamstuartwilson
iamstuartwilson / slack-file-killer.js
Last active August 8, 2018 20:58
Kill multiple slack files from your browser console. Simply paste this code when on the "https://[space].slack.com/files/[me]" page.
(function(){
$('#files_list > [data-file-id]').each(function(i) {
killIt($(this).attr('data-file-id'));
function killIt(id) {
console.log(id);
$.post('/api/files.delete', {
file: id,
token: boot_data.api_token
@iamstuartwilson
iamstuartwilson / imports-to-links.js
Created February 20, 2017 15:51
Extract @imports in <style> elements to individual <link> elements