Skip to content

Instantly share code, notes, and snippets.

View KingScooty's full-sized avatar
🚀

Scotty Vernon KingScooty

🚀
View GitHub Profile
[{"region":"East Midlands","university":"De Montfort University","url":"http://store.apple.com/uk_edu_5000657"},{"region":"East Midlands","university":"Derby University","url":"http://store.apple.com/uk_edu_5000659"},{"region":"East Midlands","university":"Jisc Collections and Janet Limited","url":"http://store.apple.com/uk_edu_5004321"},{"region":"East Midlands","university":"Leicester University","url":"http://store.apple.com/uk_edu_5000710"},{"region":"East Midlands","university":"Lincoln University","url":"http://store.apple.com/uk_edu_5000712"},{"region":"East Midlands","university":"Loughborough College","url":"http://store.apple.com/uk_edu_5000723"},{"region":"East Midlands","university":"Loughborough University","url":"http://store.apple.com/uk_edu_5002639"},{"region":"East Midlands","university":"Nottingham Trent University","url":"http://store.apple.com/uk_edu_5000747"},{"region":"East Midlands","university":"Nottingham University","url":"http://store.apple.com/uk_edu_5000748"},{"region":"East Midla
@KingScooty
KingScooty / flashSD.sh
Last active August 29, 2015 14:01
Flash an SD with a Linux image on a Mac
#Download distro to desktop and unzip.
cd ~/Desktop
#Ensure SD card is inserted and run
df -h
#Make a note of the SD card.
#It should looks something like:
#/dev/disk1s1 15Gi 2.3Mi 15Gi 1% 0 0 100% /Volumes/UNTITLED
@KingScooty
KingScooty / raspbian.sh
Last active August 29, 2015 14:01
Setting up node on a Raspberry Pi
sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade
sudo reboot
sudo rpi-update
sudo reboot
#install node
wget http://nodejs.org/dist/v0.10.26/node-v0.10.26-linux-arm-pi.tar.gz
@KingScooty
KingScooty / sass-locale.sh
Last active August 29, 2015 14:01
Fix SASS compile 'invalid US-ASCII character' error
sudo locale-gen en_GB en_GB.UTF-8
sudo dpkg-reconfigure locales
@KingScooty
KingScooty / gist:e795a8e2f29e15756e98
Created June 6, 2014 11:56
Load raspi config from startx desktop
cd /usr/bin
sudo ./raspi-config
@KingScooty
KingScooty / git_log_pretty
Created June 27, 2014 17:03
Git log pretty
git log --graph --decorate --pretty=oneline --abbrev-commit --all
@KingScooty
KingScooty / Gruntfile.js
Last active August 29, 2015 14:14
Using Grunt Assemble in Gulp
module.exports = function(grunt) {
grunt.initConfig({
assemble: {
options: {
partials: ['./app/templates/partials/**/*.hbs'],
layout: ['./app/templates/layouts/default.hbs'],
data: ['./app/data/*.json'],
helpers: ['./build-pipeline/_helpers/helper-*.js']
},
site: {
@KingScooty
KingScooty / typekit.js
Created February 3, 2015 11:32
Make Typekit non-blocking for smaller screens
<script>
//Replace this with your mobile Typekit code
var kit = 'xxxxx';
// Adjust the width threshold
if( window.innerWidth < 800 ) {
document.write('\x3Cscript src="//use.typekit.net/'+ kit +'.js" onload="try{Typekit.load();}catch(e){}" async>\x3C/script>');
} else {
document.write('\x3Cscript src="//use.typekit.net/'+ kit +'.js">\x3C/script>');
document.write('\x3Cscript>try{Typekit.load();}catch(e){}\x3C/script>');
};
@KingScooty
KingScooty / typekit.js
Created February 16, 2015 10:34
Remove Typekit from mobile devices all together.
<script>
//Replace this with your desktop Typekit code
var kit = 'xxxxx'
// Adjust the width threshold
if( window.innerWidth > 800 ) {
document.write('\x3Cscript src="//use.typekit.net/'+ kit +'.js">\x3C/script>');
document.write('\x3Cscript>try{Typekit.load();}catch(e){}\x3C/script>');
};
</script>
@KingScooty
KingScooty / gist:1355278
Created November 10, 2011 16:21 — forked from martinogden/binary_search.js
Binary Search Algorithm
def binarySearch(data, find, start, end):
"""
Search for a integer in a list of integers using a simple `Binary Search` algorithm
:param list data: list of integers sorted ascending
:param int find: integer to search for
:param int start: min array index
:param int end: max array index
:return int: index of 'find' or -1 if not found
"""