Skip to content

Instantly share code, notes, and snippets.

View mitchellhislop's full-sized avatar

Mitchell Hislop mitchellhislop

View GitHub Profile
@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)
@mitchellhislop
mitchellhislop / gist:1150240
Created August 16, 2011 21:37 — forked from niczak/gist:1150238
jQuery Form Validation
function fnValidate()
{
var aFields =
{"First Name":"sFirst",
"Last Name":"sLast",
"DRI Affiliation":"sAffil1",
"DRI Email":"sEmail_DRI"};
var bValid = true;
@mitchellhislop
mitchellhislop / php.snippets
Created April 7, 2011 04:17 — forked from aaroneaton/php.snippets
snipMate.vim file for codeigniter 2.0
# SnipMate is required to use snippets
# Download SnipMate: http://www.vim.org/scripts/script.php?script_id=2540
# Put this file in ~/.vim/snippets/ then restart vim
# This snippet file includes many useful snippets for CodeIgniter. Please feel free to fork and contribute!
snippet php
<?php
${1}
?>
snippet ec
echo "${1:string}"${2};
- simple
- public over private
- personal vanity
- internet is global
- permalinks
- one important item per page
- don't break the browser
- don't wanker in technology
- a medium is not a grande
- break convention for your users
CREATE TABLE `user` (
`twitter_id` int(10) unsigned NOT NULL,
`created_at` timestamp NOT NULL default '0000-00-00 00:00:00',
`name` varchar(80) NOT NULL,
`screen_name` varchar(30) NOT NULL,
`location` varchar(120) default NULL,
`description` varchar(640) default NULL,
`profile_image_url` varchar(400) NOT NULL,
`url` varchar(100) default NULL,
#!/usr/bin/env ruby
# twail.rb
# Twitter stream tail
# Copyright 2010 Jonathan Rudenberg
# Licensed under the MIT License
#
# Prerequisites: gem install json twitter-stream
require 'optparse'
.block { display: block; }
.inline { display: inline; }
.clrfix { display:inline-block; }
.hide { display: none; }
.fleft { float: left; }
.fright { float: right; }
.fclear { clear: both; }
.hi { background-color: rgb(255, 255, 204); }
.sub { vertical-align: sub; }
.super { vertical-align: super; }
require 'rubygems'
require 'gattica'
class ExtractKeywords
def initialize(email,password)
@gs = Gattica.new(email,password)
end
def get_accounts
results = []
@gs.accounts.each{|account|