Skip to content

Instantly share code, notes, and snippets.

View lukekarrys's full-sized avatar

Luke Karrys lukekarrys

View GitHub Profile
@lukekarrys
lukekarrys / anthonyify.js
Created August 16, 2011 20:18
Anthonyify
function walk(a,b){var c,d,e=0;do c||(c=b.call(a,e)===!1),!c&&(d=a.firstChild)?++e:(d=a.nextSibling)?c=0:(d=a.parentNode,--e,c=1),a=d;while(e>0)}walk(document.documentElement,function(){if(this.nodeType==3)this.nodeValue=this.nodeValue.replace(/./g,"ANTHONY")});
@lukekarrys
lukekarrys / README.md
Last active December 7, 2016 18:16
Cachebusting

I created this gist so at my current work, I could pass around this patch file to get local cachebusting working for development.

@lukekarrys
lukekarrys / README.md
Last active February 4, 2018 01:05
Instagram Jekyll Plugin for to Embed Photos
@lukekarrys
lukekarrys / README.md
Last active December 7, 2016 18:14
Replace all characters in text nodes that are not spaces and then "shake" the body
@lukekarrys
lukekarrys / README.md
Last active December 7, 2016 18:12
Pitchfork Review Score Scraper
@lukekarrys
lukekarrys / README.md
Last active December 7, 2016 18:08
NCAA Tournament Formatter
@lukekarrys
lukekarrys / calculate-points.js
Created April 23, 2012 03:26
Calculate total PF and PA for an NBA team from ESPN schedule page
var pointsFor = 0, pointsAgainst = 0;
jQuery('.mod-content .game-schedule .score').each(function() {
var score = jQuery(this),
win = score.prev().hasClass('win'),
scoreText = score.children('a').text().split('-'),
s1 = parseInt(scoreText[0], 0),
s2 = parseInt(scoreText[1], 0);
pointsFor += (win) ? s1 : s2;
pointsAgainst += (win) ? s2 : s1;
@lukekarrys
lukekarrys / extend-and-save.js
Created July 30, 2012 23:08
Quick Node script to merge to extend one JSON file with another and save it
/*global require console */
var _ = require('underscore'),
fs = require('fs'),
data = JSON.parse(fs.readFileSync('./data.json', 'utf-8')).data;
_.each(data, function(item) {
var newJson = item[0],
files = item[1];
@lukekarrys
lukekarrys / pluck.js
Created November 14, 2012 21:36
Pluck URL Param
/* Got this from Instagram Profile Pages http://d36xtkk24g8jdx.cloudfront.net/bluebar/c535104/scripts/bluebar.js */
function get_param(name) {
return decodeURI(
(RegExp(name + '=' + '(.+?)(&|$)').exec(location.search)||[,null])[1]
);
}
@lukekarrys
lukekarrys / README.md
Last active May 31, 2020 16:47
Node Crawler to find all domain links on a site and run a function on them

Node Crawler to find all domain links on a site and run a function on them

Linked to from http://lukecod.es/2012/11/18/random-problem-of-the-night/

What

This is a node.js crawler that will crawl an entire site (using crawl) to find all internal links in the entire site. It will then test each unique internal link for the presence of an optional string and then the query string into an object. All values with the same key from the query string will be pushed to an array for that key.

Usage