Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View KingScooty's full-sized avatar
🚀

Scotty Vernon KingScooty

🚀
View GitHub Profile
@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
"""
@KingScooty
KingScooty / binary_search.js
Created November 10, 2011 16:59 — forked from martinogden/binary_search.js
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
*/
var binarySearch = function (data, find, start, end) {
var mid = start + (end - start) / 2;
@KingScooty
KingScooty / Folder Preferences
Created February 27, 2012 15:25 — forked from chrisyour/Folder Preferences
Show hidden files and hidden folders (except .git) in your TextMate project drawer
# Want to show hidden files and folders in your TextMate project drawer? Simple, just modify the file and folder patterns in TextMate's preferences.
# Instructions:
# Go to TextMate > Preferences...
# Click Advanced
# Select Folder References
# Replace the following:
# File Pattern
@KingScooty
KingScooty / readme.md
Created November 8, 2012 12:06
Symlinking a folder from a git submodule for use in a project

#Symlink a folder from a git submodule for use in a project

I recently came across a need to try this out on a project i was working on. So here's how to do it, incase anyone else finds themselves in the same situation.

##Set up your submodule in a seperate directory.

Run this command from your project root.

git submodule add http://example.com/repo.git ./submodules/repo

[{"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