Skip to content

Instantly share code, notes, and snippets.

View edhgoose's full-sized avatar

Edward Hartwell Goose edhgoose

View GitHub Profile
{% if app.user %}
<script>
window.intercomSettings = {
app_id: "bananas",
name: "{% autoescape 'js' %}{{ app.user.UserMentionName }}{% endautoescape %}", // Full name
email: "{{ app.user.email }}", // Email address
created_at: {{ app.user.createdDate | date('U') }} // Signup date as a Unix timestamp
};
</script>
<script>(function(){var w=window;var ic=w.Intercom;if(typeof ic==="function"){ic('reattach_activator');ic('update',intercomSettings);}else{var d=document;var i=function(){i.c(arguments)};i.q=[];i.c=function(args){i.q.push(args)};w.Intercom=i;function l(){var s=d.createElement('script');s.type='text/javascript';s.async=true;s.src='https://widget.intercom.io/widget/t2nl581y';var x=d.getElementsByTagName('script')[0];x.parentNode.insertBefore(s,x);}if(w.attachEvent){w.attachEvent('onload',l);}else{w.addEventListener('load',l,false);}}})()</script>
@edhgoose
edhgoose / merginator.sh
Created January 29, 2016 23:33
Merginator: Merge master/release branches back into development
#!/bin/bash -ex
# -ex = e: fail if any non zero, x: print commands prior to running
# This script ensures that the development branch and all release branches are up to date with the branches that preceed it. master is first, then release-X in order by name, followed by development.
# How it works:
#
# 1. Strip the current branch to its raw form. (origin/master -> master, origin/release-2.5.3 -> release-2.5.3)
# 2. If the current branch is master, set the START_MERGING variable to true.
# 3. Get all the current release branches, ordered by name ascending (so 2.5.3 comes before 2.5.4 and 2.5.5)
@edhgoose
edhgoose / .gitignore
Last active August 29, 2015 14:13 — forked from karmi/.gitignore
.DS_Store
Gemfile.lock
*.pem
node.json
tmp/*
!tmp/.gitignore
#!/bin/sh
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'
@edhgoose
edhgoose / Bastardisation of rangeCheck in connect lib util.js
Created June 14, 2012 13:00
A modified version of parseRange in connectjs to deal with range requests of the form bytes=a-b, c-d where a,b,c and d are all numbers, and while a < b and c < d, there is not necessarily a correspondence between a and c or b and d.
exports.parseRange = function(size, str){
var valid = true;
console.log('Requested range: ' + str);
var arr = str.substr(6).split(',').map(function(range){
console.log(range);
var range = range.split('-')
, start = parseInt(range[0], 10)
, end = parseInt(range[1], 10);
// -500