Skip to content

Instantly share code, notes, and snippets.

View knorthfield's full-sized avatar

Kris Northfield knorthfield

View GitHub Profile
@knorthfield
knorthfield / geocode.html
Created March 11, 2013 15:54
Get Address from UK Postcode
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Get Address from Postcode</title>
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?sensor=false"></script>
<script>
var geocoder;
function codeAddress() {
geocoder = new google.maps.Geocoder();
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="https://cdn.jsdelivr.net/gh/paperjs/paper.js@0.12.11/dist/paper-full.js"></script>
<script type="text/paperscript" canvas="myCanvas">
var background = new Path.Rectangle(view.bounds);
background.fillColor = 'white';
var think = new Path.Circle(new Point(115, 120), 55);
think.strokeColor = '#B42371';
@knorthfield
knorthfield / script_attributes.js
Created June 14, 2013 16:18
Access script tag attributes in script.
<script type="text/javascript" data-message="hello">
var scripts = document.getElementsByTagName( 'script' );
console.log(scripts[ scripts.length - 1 ].getAttribute('data-message'));
</script>
@knorthfield
knorthfield / Cron Setup
Created August 6, 2013 09:26
Setting up Cron on OS X
1 Start up Terminal
2 Type "cd ~/" to go to your home folder
3 Type "touch .bash_profile" to create your new file.
4 Edit .bash_profile with your favorite editor (or you can just type "open -e .bash_profile" to open it in TextEdit.
5 Type ". .bash_profile" to reload .bash_profile and update any functions you add.
6 Add "export EDITOR=/usr/bin/nano" to make nano default editor
7 crontab -e
8 Add Follwing template:
# .---------------- minute (0 - 59)
@knorthfield
knorthfield / gist:6682895
Created September 24, 2013 10:23
Generate htpasswd hash
htpasswd -nmb username password
@knorthfield
knorthfield / greensock-scroll-scrubber.html
Created October 21, 2013 12:33
Connect page scroll to Greensock animation scrubber
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/gsap/latest/TweenMax.min.js"></script>
<script>
$(function(){
@knorthfield
knorthfield / keywords.txt
Last active August 29, 2015 14:02
2inspire Keyword Reasearch
leadership management
management and leadership
leadership styles (management styles, laissez faire leadership, democratic leadership, leadership style, types of leadership, styles of leadership, leadership and management styles, different types of leadership, different styles of leadership, charismatic leaders, leadership approaches, leadership types, leadership strategies, management and leadership styles, what is leadership style, lean leadership, types of leader, leadership styles in business, effective leadership styles, leadership styles in management, understanding leadership styles, 6 styles of leadership, different approaches to management and leadership, different styles of leadership and management, leadership management styles, three leadership styles, what are the different leadership styles, management style theories, leadership style theories, team leadership styles, leadership methods, types of leadership skills, what are the leadership styles, what leadership styles are there, model of leade
@knorthfield
knorthfield / ffsx-apis
Created July 11, 2014 14:22
FFSX APIs
http://fantasy.premierleague.com/web/api/elements/691/
http://nbviewer.ipython.org/urls/dl.dropboxusercontent.com/u/8169386/FantasyLeague/GettingFantasyFootballData.ipynb

Keybase proof

I hereby claim:

  • I am knorthfield on github.
  • I am knorthfield (https://keybase.io/knorthfield) on keybase.
  • I have a public key whose fingerprint is E7D2 47A1 A60A 2D9C 6204 F0EF 6817 A706 995E FFDD

To claim this, I am signing this object:

@knorthfield
knorthfield / scroll-fix.js
Last active August 29, 2015 14:13
Fix element when scrolled offscreen
$(function(){
var unfix_distance = $('nav#menu').offset().top,
$fixed_element = $('nav#menu');
window.onresize = function() {
unfix_distance = $('nav#menu').offset().top;
}
$(window).scroll(function(){