Skip to content

Instantly share code, notes, and snippets.

View gotomanners's full-sized avatar

Manners gotomanners

  • Dublin, Ireland
View GitHub Profile
SSH in as root
By default you’re in /storage; switch to root partition:
cd /
Keep XBMC from restarting:
touch /var/lock/xbmc.disabled
Stop XBMC, so we can unmount /storage:
killall -9 xbmc.bin
umount /storage
Verify mounts:
mount
@gotomanners
gotomanners / dynamicUpdate.sh
Created December 6, 2013 20:44
Update IP address to domain service
Dynamic DNS
By using a domain name service, you can easily connect to your Raspberry Pi when you are not home. This is actually necessary if the IP address given by your provider changes frequently. But also if you always have the same IP: simply using a pretty url to connect is nice.
Schedule this script to run every x hours, mine runs every 4 hours:
crontab -e
add this line at the bottom:
0 */4 * * * sudo sh /etc/ipupdate/ipupdate.sh
# this script will check if the current external IP address has been
var result = {
messages: [
["Loading...", 0],
["Still loading... sorry", 2],
["Ok, it seems this is taking longer than we first thought. :(", 5],
["Your request seems to have failed, we shall investigate!", 5]
],
cur: 0,
id: '',
timer: '',
# xcode-build-bump.sh
# @desc Auto-increment the build number every time the project is run.
# @usage
# 1. Select: your Target in Xcode
# 2. Select: Build Phases Tab
# 3. Select: Add Build Phase -> Add Run Script
# 4. Paste code below in to new "Run Script" section
# 5. Drag the "Run Script" below "Link Binaries With Libraries"
# 6. Insure that your starting build number is set to a whole integer and not a float (e.g. 1, not 1.0)
@gotomanners
gotomanners / CoreDataTableViewController.h
Created November 15, 2013 12:57
CoreData TableViewController
//
// CoreDataTableViewController.h
//
// Created for Stanford CS193p Winter 2013.
// Copyright 2013 Stanford University. All rights reserved.
//
// This class mostly just copies the code from NSFetchedResultsController's documentation page
// into a subclass of UITableViewController.
//
// Just subclass this and set the fetchedResultsController.
@gotomanners
gotomanners / jquery.spin.js
Created November 25, 2012 05:13 — forked from innotekservices/jquery.spin.js
jQuery Plugin for Spin.js
/*
You can now create a spinner using any of the variants below:
$("#el").spin(); // Produces default Spinner using the text color of #el.
$("#el").spin("small"); // Produces a 'small' Spinner using the text color of #el.
$("#el").spin("large", "white"); // Produces a 'large' Spinner in white (or any valid CSS color).
$("#el").spin({ ... }); // Produces a Spinner using your custom settings.
$("#el").spin(false); // Kills the spinner.
@gotomanners
gotomanners / index.html
Created November 9, 2012 09:17
A CodePen by David DeSandro. Beyonce Seamless Masonry Technique - As designed by designedmemory See iam.beyonce.com
<header>
<h1>Beyonce Seamless Masonry Technique</h1>
<p>As designed by <a href="http://www.designedmemory.com/">designedmemory</a></p>
<p>See <a href="http://iam.beyonce.com/">iam.beyonce.com</a></p>
</header>
<div id="container">
<div class="item"><img src="http://placekitten.com/300/350" /></div>
<div class="item"><img src="http://placekitten.com/300/300" /></div>
<div class="item"><img src="http://placekitten.com/300/450" /></div>
@gotomanners
gotomanners / gist:3834564
Created October 4, 2012 15:55
Load a JS or CSS file dynamically
var loadResource = function (filename, filetype){
var loadedResource = undefined;
if (filetype === "js"){ //if filename is a external JavaScript file
loadedResource=document.createElement('script');
loadedResource.setAttribute("type","text/javascript");
loadedResource.setAttribute("src", filename);
}
else if (filetype === "css"){ //if filename is an external CSS file
loadedResource=document.createElement("link");
loadedResource.setAttribute("rel", "stylesheet");
@gotomanners
gotomanners / Xcode versions and IOS support.txt
Created October 2, 2012 13:45
Xcode versions and IOS support
As of 9.19.2012:
Xcode 4.5 is the latest general release for Mountain Lion [specs]:
Build #: 4G182 (same as GM)
Includes iOS SDK: iOS 6.0
Includes Mac SDK: Mac OS X 10.8
Requires 10.7.4 and up
Available via the Mac App Store*
Includes the ability for Delta updates from the store
iPhone 5 support (4-inch launch image & armv7s) requires Xcode 4.5
@gotomanners
gotomanners / executeSqlBridgeForPhonegapSQLitePlugin.js
Created September 26, 2012 16:31 — forked from orbitaloop/executeSqlBridgeForPhonegapSQLitePlugin.js
executeSql Bridge For PhonegapSQLitePlugin (because there are some differences between the WebSQL API and the plugin)
/* to use WebSQL or the SQLite plugin (https://github.com/davibe/Phonegap-SQLitePlugin) with the same function) */
executeSqlBridge: function(tx, sql, params, dataHandler, errorHandler) {
var self = this;
if (typeof self.db.dbPath !== 'undefined') {
//Native SQLite DB with phonegap : https://github.com/davibe/Phonegap-SQLitePlugin/
//this is a native DB, the method signature is different:
var sqlAndParams = [sql].concat(params);
var cb = function(res) {