Skip to content

Instantly share code, notes, and snippets.

View EldonMcGuinness's full-sized avatar

Eldon McGuinness EldonMcGuinness

View GitHub Profile
@EldonMcGuinness
EldonMcGuinness / Jekyll.sublime-build
Last active August 29, 2015 14:21
Sublime Text 3 - Build Jekyll Site and Publish to Directory
{
"cmd": ["jekyll","b"],
"shell": true,
"working_dir": "${project_path:${folder}}",
"selector": "source.markdown",
"variants": [
{
"name": "Copy site to Live Directory",
"cmd": ["cp", "-fuR", "SOURCE_DIR", "DEST_DIR"],
@EldonMcGuinness
EldonMcGuinness / jquery.qsParameters.js
Last active February 21, 2016 17:24
JQuery Querystring Parser
(function ( $ ) {
$.qsParameters = function(str) {
var qso = {};
var qs = (str || document.location.search)
// Check for an empty querystring
if (qs == ""){
return qso;
}
@EldonMcGuinness
EldonMcGuinness / KodiBackup.sh
Created August 23, 2015 02:57
KODI Cloning Script
### This should be run from /sdcard/Android/data/org.xbmc.kodi/files
tar cvzf /usbdisk/kodi_backup.tar.gz --exclude=.kodi/userdata/Database/Textures13.db --exclude=.kodi/userdata/Thumbnails --exclude=.kodi/temp .kodi
@EldonMcGuinness
EldonMcGuinness / social-media-colours.css
Created September 19, 2015 03:13
Social Media Colours CSS
twitter: #00aced rgb(0, 172, 237)
facebook: #3b5998 rgb(59, 89, 152)
googleplus: #dd4b39 rgb(221, 75, 57)
pinterest: #cb2027 rgb(203, 32, 39)
linkedin: #007bb6 rgb(0, 123, 182)
youtube: #bb0000 rgb(187, 0, 0)
vimeo: #aad450 rgb(170, 212, 80)
tumblr: #32506d rgb(50, 80, 109)
instagram: #517fa4 rgb(81, 127, 164)
flickr: #ff0084 rgb(255, 0, 132)
#!/bin/sh
for i in *.cb*; do
echo $i
mkdir -p temp rebuilt
case "$i" in
*.cbr)
unrar e -o+ "$i" temp
;;
@EldonMcGuinness
EldonMcGuinness / numGenerator.py
Created January 1, 2017 20:03
A short script to generate permutations based on a rance of numbers.
#!/usr/bin/python2.7
import sys, getopt, itertools
def help():
print('test.py -r <range> -l <length> -o <outputfile> -c <count>')
def main(argv):
genRange = None
@EldonMcGuinness
EldonMcGuinness / tar-upload
Last active June 7, 2017 19:52
Tar and Upload
#!/bin/bash
SOURCE=
DEST=
RSA_KEY=
usage() {
cat << EOF
usage: $0 options
var jq = document.createElement('script');
jq.src = "https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js";
document.getElementsByTagName('head')[0].appendChild(jq);
function strip(str) {
return str.replace(/^\s+|\s+$/g, '');
}
var json = {};
var productArray = Array();
@EldonMcGuinness
EldonMcGuinness / openpgp.txt
Created January 12, 2018 04:35
OpenKeychain Linked Identity
This Gist confirms the Linked Identity in my OpenPGP key, and links it to this GitHub account.
Token for proof:
[Verifying my OpenPGP key: openpgp4fpr:473be7a8a6255fef1a8ccf27302f0e72ccb6f5ff]
@EldonMcGuinness
EldonMcGuinness / epub2mobi
Created February 10, 2018 23:09
Convert epub to mobi using calibre, see included note for bulk converting
#!/bin/bash
FILE=$(basename "$1" .epub)
if [ -e "${FILE}.mobi" ]; then
echo nothing to do
else
echo converting
ebook-convert "${FILE}.epub" "${FILE}.mobi"
fi