Skip to content

Instantly share code, notes, and snippets.

View lilmuckers's full-sized avatar

Patrick McKinley lilmuckers

View GitHub Profile
@lilmuckers
lilmuckers / page_weights.html
Created April 7, 2013 01:18
Liquid page weighting
<ul>
{% for weight in (0..100) %}
{% for node in site.pages %}
{% if node.weight == weight or node.weight == null and weight == 0 %}
<li>
<a href="{{node.url}}" title="{{node.title}}">{{node.title}}</a>
</li>
{% endif %}
{% endfor %}
{% endfor %}
@lilmuckers
lilmuckers / commit.js
Last active February 10, 2023 08:07
A node.js script that utilises the githubber node.js GitHub API integration module to commit changes to a repository
//set up the object with the api details
function GitHubCommit(api, owner, repo, ref)
{
this.api = api;
this.repo = {
owner: owner,
repo: repo,
ref: ref
}
}
@lilmuckers
lilmuckers / github.js
Last active December 15, 2015 22:09
GitHub authorisations API script for Flatiron.js, using Githubber library, and uses a configured client secret and client token.
var GitHub = require('githubber');
//run the function
var github = module.exports = function github (cmd, cb) {
//setup the user input schema
var schema = {
properties: {
username: {
pattern: /^[a-zA-Z\s\-]+$/,
@lilmuckers
lilmuckers / oauth.js
Last active December 15, 2015 22:09
A browser based javascript app to get an oauth access_token from GitHub via the webpage, with added google analytics.
jQuery(function($){
//github API url
var ghUrl = 'https://api.github.com/authorizations'
//the form - the response is in a form because... reasons...
var form = $('#ghAuthApi')
var responseForm = $('#ghAuthApiResponse')
//a function to do our field mapping
@lilmuckers
lilmuckers / error.js
Created April 11, 2013 11:50
Error handler that uses the github API to create an issue as a way of logging the error. This depends on the githubber npm library.
//set up the object with the api details
function GitHubError(api, owner, repo)
{
this.api = api
this.repo = {
owner: owner,
repo: repo
}
}
@lilmuckers
lilmuckers / slugify.js
Last active September 25, 2017 08:38
Javascript Slugify function.
String.prototype.slugify = function()
{
var p = ['.', '=', '-'];
var s = '-';
//now we need to do some fiddling with special characters
var replaceArray = {
'a': /à|á|å|â/,
'e': /è|é|ê|ẽ|ë/,
'i': /ì|í|î/,
@lilmuckers
lilmuckers / xbl.js
Created June 26, 2013 21:04
CasperJS script to pull Xbox LIve data
//spawn the casper process
var casper = require("casper").create();
var sourceString = '';
//get the URL
if(casper.cli.has(0)){
var url = casper.cli.get(0)
} else {
casper
@lilmuckers
lilmuckers / deploy.sh
Last active April 11, 2016 12:33
A "simple" node.js deployment script - runs npm install, bower install, and gulp build, before starting using a forever config file. Will report the status of the deployment back to slack, as well as posting errors where appropriate.
#!/bin/bash
###### Deploy Vars ######
# The deployment root path
DEPLOYROOT=/home/node/deploy/
FOREVERCONFIG=./forever.json
CURLCHECKURL=http://localhost/
BITBUCKET=https://bitbucket.org/user/repo
MAINURL=http://webhost.com/
@lilmuckers
lilmuckers / pope_song.txt
Created December 1, 2016 16:38
The Pope Song
Fuck the mother fucker, Fuck the mother fucker, Fuck the mother fucker He's a fucking mother fucker, , Fuck the mother fucker, Fuck the fucking fucker, Fuck the mother fucker He's a total fucking fucker, , Fuck the mother fucker, Fuck the mother fucker, Fuck the mother fucker Fucking fuck the mother fucker, , Fuck the mother fucker, Fuck the mother fucking Pope., , Fuck the mother fucker, And fuck you mother fucker, If you think that mother fucker is sacred, If you cover for another mother fucker Who's a kiddie fucker Fuck you you're no better Than the mother fucking rapist, , And if you don't like the swearing That this mother fucker forced from me And reckon it shows moral Or intellectual paucity, Then fuck you mother fucker This is language one employs, When one is fucking cross About fuckers fucking boys, , I don't give a fuck if calling The Pope a mother fucker Means you unthinkingly brand me An unthinking apostate, , This has nowt to do with other Fucking Godly mother fuckers I'm not interested right no

Keybase proof

I hereby claim:

  • I am lilmuckers on github.
  • I am lilmuckers (https://keybase.io/lilmuckers) on keybase.
  • I have a public key ASB2se3WybHe3b5IXyXErglyCI-MGBADOW3pktH3LScdhAo

To claim this, I am signing this object: