Forked from maedeh's Pen Robot pure css.
A Pen by Captain Anonymous on CodePen.
if (localStorage.getItem("dbCreated") != true) { | |
html5sql.openDatabase("ScratchDB", "Scratch DB", 3 * 1024 * 1024); | |
var request = new XMLHttpRequest(); | |
request.open("GET", "file:///android_asset/www/create.sql", true); | |
request.onreadystatechange = function(){ | |
if (request.readyState == 4) { | |
if (request.status == 200 || request.status == 0) { | |
html5sql.process(request.responseText, | |
function(){ | |
console.log("Win!"); |
function loadTweets() { | |
var request = new XMLHttpRequest(); | |
request.open("GET", "http://search.twitter.com/search.json?q=phonegap", true); | |
request.onreadystatechange = function() {//Call a function when the state changes. | |
if (request.readyState == 4) { | |
if (request.status == 200 || request.status == 0) { | |
var tweets = JSON.parse(request.responseText); | |
var data = "<table cellspacing='0'>"; | |
var tableClass; | |
for (i = 0; i < tweets.results.length; i++) { |
CREATE TABLE example (id INTEGER PRIMARY KEY, data TEXT); | |
INSERT INTO example (data) VALUES ('First'); | |
INSERT INTO example (data) VALUES ('Second'); | |
INSERT INTO example (data) VALUES ('Third'); | |
CREATE TABLE example2 (id INTEGER PRIMARY KEY, data TEXT); | |
INSERT INTO example2 (data) VALUES ('First'); | |
INSERT INTO example2 (data) VALUES ('Second'); | |
INSERT INTO example2 (data) VALUES ('Third'); |
function backupAllTheContacts() { | |
navigator.contacts.find(["*"], function(contacts) { | |
console.log("contacts.length = " + contacts.length); | |
window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, function(fileSystem) { | |
fileSystem.root.getFile("contacts.bak", {create: true, exclusive: false}, function(fileEntry) { | |
fileEntry.createWriter(function(writer) { | |
writer.onwriteend = function() { | |
console.log("backup complete"); | |
}; | |
writer.write(JSON.stringify(contacts)); |
<?php | |
require 'tmhOAuth.php'; // Get it from: https://github.com/themattharris/tmhOAuth | |
// Use the data from http://dev.twitter.com/apps to fill out this info | |
// notice the slight name difference in the last two items) | |
$connection = new tmhOAuth(array( | |
'consumer_key' => '', | |
'consumer_secret' => '', | |
'user_token' => '', //access token |
if (typeof window.localStorage == 'undefined' || typeof window.sessionStorage == 'undefined') (function () { | |
var Storage = function (type) { | |
function createCookie(name, value, days) { | |
var date, expires; | |
if (days) { | |
date = new Date(); | |
date.setTime(date.getTime()+(days*24*60*60*1000)); | |
expires = "; expires="+date.toGMTString(); |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<meta name="description" content="Short example on using indexedDB with jquery mobile - last updated: May 2012"> | |
<meta name="author" content="Ido Green"> | |
<title>IndexedDB with JQM</title> |
Forked from maedeh's Pen Robot pure css.
A Pen by Captain Anonymous on CodePen.
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
Typing vagrant
from the command line will display a list of all available commands.
Be sure that you are in the same directory as the Vagrantfile when running these commands!
vagrant up
-- starts vagrant environment (also provisions only on the FIRST vagrant up)vagrant status
-- outputs status of the vagrant machinevagrant halt
-- stops the vagrant machinevagrant reload
-- restarts vagrant machine, loads new Vagrantfile configurationvagrant provision
-- forces reprovisioning of the vagrant machine