Skip to content

Instantly share code, notes, and snippets.

View mitchellhislop's full-sized avatar

Mitchell Hislop mitchellhislop

View GitHub Profile
@mitchellhislop
mitchellhislop / all_sites_header.html
Last active June 22, 2018 19:57
Please insert content of all_sites_header.html between the <head> tags on the .de site
<link rel="alternate" href="https://tensewatch.com" hreflang="en-us" />
<link rel="alternate" href="https://tensewatch.ca" hreflang="en-ca" />
<link rel="alternate" href="https://www.tensewatch.de" hreflang="de-de" />
<link rel="alternate" href="https://tensewatch.com" hreflang="en" />
@mitchellhislop
mitchellhislop / gist:4e870851bab15585b801dc23ee5e4a0a
Created August 2, 2016 21:43
Google Analytics: HTML5 Video Tracking
document.addEventListener('DOMContentLoaded', init, false)
var videoId = document.getElementById('video')
//var videoTitle = videoId.getAttribute('data-description')
var videoTitle = '宝宝身边有怪物'
function init () {
videoId.addEventListener('ended', videoEnd, false)
videoId.addEventListener('timeupdate', videoTimeUpdate, false)
videoId.addEventListener('play', videoPlay, false)

Keybase proof

I hereby claim:

  • I am mitchellhislop on github.
  • I am mitchellhislop (https://keybase.io/mitchellhislop) on keybase.
  • I have a public key whose fingerprint is 1A71 0D09 7372 B9FD 7F50 48CF 0741 52EC FE83 1DCB

To claim this, I am signing this object:

@mitchellhislop
mitchellhislop / Twitter.scala
Created August 21, 2013 03:07
Twitter boilerplate for scala + play
package controllers
import play.api.Play.current
import play.api.libs.oauth.{RequestToken, ServiceInfo, ConsumerKey, OAuth}
import play.api.mvc.{RequestHeader, Action, Controller}
import play.api.Play
object Twitter extends Controller {
val cfg = Play.application.configuration
@mitchellhislop
mitchellhislop / twittertypeahead.js
Created July 2, 2013 18:49
What a cool plugin. Fully awesome typeahead in ~25 lines.
$('#school .typeahead').typeahead({
name: 'schools',
prefetch: {
url: '/schoolsforstate/'+ state
filter: (data)->
$.each data, ()->
datumAdd = {
value: this.school_name
id: this.id
tokens:[
echo "main(i){for(i=0;;i++)putchar(((i*(i>>8|i>>9)&46&i>>8))^(i&i>>13|i>>6));}" | gcc -x c - && ./a.out | aplay
@mitchellhislop
mitchellhislop / application.conf
Last active December 18, 2015 21:58
Logback xml for Scala/Play logging
db.default.logStatements=true
//Add that to the application.conf, and comment out the Logger lines (~50 - ~60). Restart the play app, and you are now logging with gas!
@mitchellhislop
mitchellhislop / .tmux.conf
Created April 24, 2013 15:14
My Tmux conf
# set the command prefix to match gnuscreen (i.e. CTRL+a)
set -g prefix C-a
bind-key C-a last-window
# utf8
set-window-option -g utf8 on
# statusbar background to black, foreground to white
set-option -g status-fg white
set-option -g status-bg black
@mitchellhislop
mitchellhislop / browserdetective.js
Created March 11, 2012 21:58
Browser Detective
<script>
var BrowserDetect = {
init: function() {
this.browser = this.searchString(this.dataBrowser) || "An unknown browser";
this.version = this.searchVersion(navigator.userAgent) || this.searchVersion(navigator.appVersion) || "an unknown version";
this.OS = this.searchString(this.dataOS) || "an unknown OS";
},
searchString: function(data) {
for (var i = 0; i < data.length; i++) {
var dataString = data[i].string;
@mitchellhislop
mitchellhislop / simplemodal.js
Created January 30, 2012 20:28
SimpleModal Setup
$(document).ready(function(){
$('.ssa_button').click(function(event){
if (console.log)
{
console.log('in click handler with ' + $(this).data('vid-id'));
}
//stop the bubble and prop
event.preventDefault();
//cache the jQ object
var frame = $('#vid_frame');