Skip to content

Instantly share code, notes, and snippets.

View gotomanners's full-sized avatar

Manners gotomanners

  • Dublin, Ireland
View GitHub Profile
@gotomanners
gotomanners / gist:3531449
Created August 30, 2012 15:49
Updating Forked Repos
From :: http://bradlyfeeley.com/2008/09/03/update-a-github-fork-from-the-original-repo/
First you need to add a remote branch to your repository that points to the original repo you forked from.
git remote add --track master mleung git://github.com/mleung/feather.git
You will want to replace ‘master’ with the branch you want to track in the remote repo. In most cases this will be master, although you could replace it with edge or any other branch. You should also replace ‘mleung’ is what you the remote will be called.
To verify the remote repository was added run
@gotomanners
gotomanners / gist:3545133
Created August 30, 2012 23:34
HEROKU :: push non master branch to heroku master branch
git push heroku yourbranch:master
@gotomanners
gotomanners / gist:3710304
Created September 12, 2012 22:08
Javascript inheritance(prototype)
Object.make = function make (proto) {
var o = Object.create(proto);
var args = [].slice.call(arguments, 1);
args.forEach(function (obj) {
Object.getOwnPropertyNames(obj).forEach(function (key) {
o[key] = obj[key];
});
});
return o;
}
@gotomanners
gotomanners / gist:3788039
Created September 26, 2012 13:28 — forked from shazron/gist:2127546
iOS WebKit Database Locations

iOS WebKit Database Locations

"~" signifies the application's folder.

window.localStorage (4.3)

  1. ~/Library/WebKit/LocalStorage/file__0.localstorage
@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) {
@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 / 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 / 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 / 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 / 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.