Skip to content

Instantly share code, notes, and snippets.

View knorthfield's full-sized avatar

Kris Northfield knorthfield

View GitHub Profile
@knorthfield
knorthfield / implode.php
Created July 21, 2016 16:58
Make text from array with keys
$message = implode("\n", array_map(function ($v, $k) { return $k . ': ' . $v; }, $_POST, array_keys($_POST)));
@knorthfield
knorthfield / numbers_explode.txt
Created May 31, 2016 09:54
Formulas for numbers to get first and last name from full name
LEFT(A2,FIND(" ",A2)−1)
RIGHT(A2,LEN(A2)−FIND(" ",A2))
@knorthfield
knorthfield / post_to_csv.php
Last active August 29, 2015 14:23
Add $_POST values to CSV
<?php
if( $_SERVER['REQUEST_METHOD'] == 'post' ){
$fp = fopen('../registrations.csv', 'a');
fputcsv($fp, $_POST);
fclose($fp);
}
?>
@knorthfield
knorthfield / gist:e9c0519a113f4ef4304f
Last active August 29, 2015 14:18
Remove an HTML element
var clear = document.getElementById('clear'),
overlay = document.getElementById('overlay');
clear.addEventListener('click', function(){
overlay.parentNode.removeChild(overlay);
})
@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(){

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 / 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
@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 / 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 / gist:6682895
Created September 24, 2013 10:23
Generate htpasswd hash
htpasswd -nmb username password