Skip to content

Instantly share code, notes, and snippets.

adb logcat | grep 'Web Console'
- or -
adb logcat | grep "CONSOLE"
@aidansmyth
aidansmyth / PhoneGap SQLite example
Last active January 3, 2016 22:39 — forked from edwardtoday/gist:2204864
Phonegap SQLite example
<!DOCTYPE html>
<html>
<head>
<!--
This is an example that shows how to create an application that uses
an embedded sqlite database
in a mobile device (iphone,ipod,ipad,android using phonegap, jquery
and sqlite.
map = {}
map.width = 79
map.height = 21
map.cellWidth = 13
map.cellHeight = 7
map.rooms = {}
map = {}
map.width = 70
map.height = 30
function initMap()
for i = 1, map.width do
map[i] = {}
for j = 1, map.height do
map[i][j] = "."
// Includes functions for exporting active sheet or all sheets as JSON object (also Python object syntax compatible).
// Tweak the makePrettyJSON_ function to customize what kind of JSON to export.
var FORMAT_ONELINE = 'One-line';
var FORMAT_MULTILINE = 'Multi-line';
var FORMAT_PRETTY = 'Pretty';
var LANGUAGE_JS = 'JavaScript';
var LANGUAGE_PYTHON = 'Python';
@aidansmyth
aidansmyth / Copy table functions
Created July 4, 2013 14:01
Lua functions to copy a table not just reference the original table and it's data
-- From: lua-users.org
-- http://lua-users.org/wiki/CopyTable
--[[
Shallow Copy
This a simple, naive implementation. It only copies the top level value and its direct children; there is no handling of deeper children, metatables or special types such as userdata or coroutines. It is also susceptible to influence by the __pairs metamethod.
]]--
function shallowcopy(orig)
##############################################################################
# gitignore template
#
# Based on article: https://help.github.com/articles/ignoring-files
##############################################################################
# Project specific files #
##########################
@aidansmyth
aidansmyth / httpd-vhosts.conf
Created March 21, 2013 20:36
Virtual hosts configuration on localhost
# Default wamp vhost
#<VirtualHost *:80>
# ServerAdmin webmaster@dummy-host2.example.com
# DocumentRoot "c:/Apache2/docs/dummy-host2.example.com"
# ServerName dummy-host2.example.com
# ErrorLog "logs/dummy-host2.example.com-error.log"
# CustomLog "logs/dummy-host2.example.com-access.log" common
#</VirtualHost>
<VirtualHost *:80>
# ==============================================================================
# REQUIRED 3RD PARTY COMPASS EXTENSIONS
# ==============================================================================
# require ''
# ==============================================================================
# COMPASS PROJECT CONFIGURATION
# ==============================================================================
# Can be `:stand_alone` or `:rails`. Defaults to `:stand_alone`.
(function(){
if (typeof boilerplate_bookmarklet == 'undefined') {
var stylesheet_url = 'http://example.com/bookmarklet.css';
var script_url = 'http://example.com/bookmarklet.js';
var head = document.getElementsByTagName('head')[0] || document.documentElement;
var stylesheet = document.createElement('link');
stylesheet.setAttribute('rel', 'stylesheet');
stylesheet.setAttribute('type', 'text/css');