Getting started:
Related tutorial: http://cd64.de/mysql-cli
SQL joins infografic: http://cd64.de/sql-joins
| /*--- waitForKeyElements(): A utility function, for Greasemonkey scripts, | |
| that detects and handles AJAXed content. | |
| Usage example: | |
| waitForKeyElements ( | |
| "div.comments" | |
| , commentCallbackFunction | |
| ); |
Getting started:
Related tutorial: http://cd64.de/mysql-cli
SQL joins infografic: http://cd64.de/sql-joins
Had fun cutting up this Free UI kit from Dribbble.
Check out the original work here.
http://dribbble.com/shots/1434502-Ui-Kit
Forked from Tyler Fry's Pen Ui Kit Dribbble Rebound.
| // Getting a file through XMLHttpRequest as an arraybuffer and creating a Blob | |
| var rhinoStorage = localStorage.getItem("rhino"), | |
| rhino = document.getElementById("rhino"); | |
| if (rhinoStorage) { | |
| // Reuse existing Data URL from localStorage | |
| rhino.setAttribute("src", rhinoStorage); | |
| } | |
| else { | |
| // Create XHR and FileReader objects | |
| var xhr = new XMLHttpRequest(), |
| // IndexedDB | |
| window.indexedDB = window.indexedDB || window.webkitIndexedDB || window.mozIndexedDB || window.OIndexedDB || window.msIndexedDB, | |
| IDBTransaction = window.IDBTransaction || window.webkitIDBTransaction || window.OIDBTransaction || window.msIDBTransaction, | |
| dbVersion = 1; | |
| /* | |
| Note: The recommended way to do this is assigning it to window.indexedDB, | |
| to avoid potential issues in the global scope when web browsers start | |
| removing prefixes in their implementations. |
| // Create an objectStore | |
| console.log("Creating objectStore") | |
| dataBase.createObjectStore("elephants"); |
| // Open a transaction to the database | |
| var transaction = db.transaction(["elephants"], IDBTransaction.READ_WRITE); |
| // Put the blob into the dabase | |
| transaction.objectStore("elephants").put(blob, "image"); |
| // Retrieve the file that was just stored | |
| transaction.objectStore("elephants").get("image").onsuccess = function (event) { | |
| var imgFile = event.target.result; | |
| console.log("Got elephant!" + imgFile); | |
| // Get window.URL object | |
| var URL = window.URL || window.webkitURL; | |
| // Create and revoke ObjectURL | |
| var imgURL = URL.createObjectURL(imgFile); |
| (function () { | |
| // IndexedDB | |
| var indexedDB = window.indexedDB || window.webkitIndexedDB || window.mozIndexedDB || window.OIndexedDB || window.msIndexedDB, | |
| IDBTransaction = window.IDBTransaction || window.webkitIDBTransaction || window.OIDBTransaction || window.msIDBTransaction, | |
| dbVersion = 1.0; | |
| // Create/open database | |
| var request = indexedDB.open("elephantFiles", dbVersion), | |
| db, | |
| createObjectStore = function (dataBase) { |