This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
User setup | |
http://articles.slicehost.com/2010/4/30/ubuntu-lucid-setup-part-1 | |
(follow all the steps up until ipTables) | |
Install essentials and compilers | |
# sudo aptitude update | |
# sudo apt-get install build-essential zlib1g zlib1g-dev | |
Install CURL | |
# sudo apt-get install curl |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Websites: Foundational Elements | |
//SEO | |
* Unique Title and Meta Description for each page | |
* Use of Schema.org to mark-up relevant content, large or small (http://schema.org/docs/schemas.html) | |
//Sharing | |
* For sites/pages that are meant to be shared (all?), use Facebook OG Tags (http://developers.facebook.com/docs/opengraphprotocol/) | |
* Test and optimize product/portfolio pages for sharing via Facebook and Pinterest |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
This is a small class for replicating the most often-used (by me, at least) jQuery functionality in 2kb. Tested in newest browsers and IE8. Examples follow. | |
Includes: | |
* Find elements | |
* Create element | |
* Update attributes for element | |
* Iterate through elements with callback | |
* Bind events with callback | |
* Empty children from element | |
* Load script |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Includes a fix for using the back button | |
* Title default to placeholder for HTML5 support | |
* @author Remy Sharp | |
* @url http://remysharp.com/2007/01/25/jquery-tutorial-text-box-hints/ | |
*/ | |
(function ($) { | |
$.fn.hint = function (blurClass) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Converts form selects to style-able elements using a span for the value, a ul for the options and a wrapper for extra control | |
* Keeps default form methods intact (automatically updates select, doesn't effect submit, uses label) | |
* Updates based on selected value on page load | |
*/ | |
(function ($) { | |
$.fn.selectGui = function () { | |
var z = 1000; | |
return this.each(function () { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Edits to the jSwipe jquery plugin to better handle swiping without losing default scroll functionality on mobile devices | |
* jSwipe - jQuery Plugin | |
* http://plugins.jquery.com/project/swipe | |
* http://www.ryanscherf.com/demos/swipe/ | |
* Replace the touchMove function with the following: | |
*/ | |
function touchMove(event) { | |
finalCoord.x = event.targetTouches[0].pageX // Updated X,Y coordinates |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Model methods below requires Joli.js: https://github.com/xavierlacot/joli.js | |
Requires a tables named 'migrations' with columns id & version | |
Database migrations | |
Each migration is attached to a timestamp | |
When the migration is run, a record is added to the migrations table so it isn't run again | |
The rollback function takes a string date and rolls back all migrations since that date and deletes the migration record | |
Usage: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Joli is a lightweight js ORM built for Titanium Apps: | |
//https://github.com/xavierlacot/joli.js | |
//Add this to joli.query.prototype | |
/* | |
Create HABTM query | |
Assume standard relationship table naming standards | |
Attempt to create local and foreign key from relationship table if none is declared | |
*/ | |
fromThrough: function(table, relation_table, local_key, foreign_key, local_table, foreign_table) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var r = Raphael("holder"); | |
r.customAttributes.segment = function (x, y, r, a1, a2) { | |
var flag = (a2 - a1) > 180, | |
clr = (a2 - a1) / 360; | |
a1 = (a1 % 360) * Math.PI / 180; | |
a2 = (a2 % 360) * Math.PI / 180; | |
return { | |
path: [["M", x, y], ["l", r * Math.cos(a1), r * Math.sin(a1)], ["A", r, r, 0, +flag, 1, x + r * Math.cos(a2), y + r * Math.sin(a2)], ["z"]], | |
fill: "hsb(" + clr + ", .75, .8)" | |
}; |
NewerOlder