Skip to content

Instantly share code, notes, and snippets.

@nathanpc
nathanpc / main.js
Created June 9, 2012 19:56
bb.init() Example
bb.init({
onscreenready: function (element, id) {
if (id == "main") {
// code to be executed before the "main" screen is loaded.
} else if (id == "add") {
// code to be executed before the "add" screen is loaded.
}
},
ondomready: function (element, id) {
if (id == "main") {
@nathanpc
nathanpc / index.html
Created June 9, 2012 19:53
image-list item declaration
<div data-bb-type="item" data-bb-title="Title goes here" data-bb-img="images/test.png" onclick="alert('this was clicked')">A description is welcome.</div>
@nathanpc
nathanpc / main.js
Created June 9, 2012 19:57
Wrong onscreenready Example
bb.init({
onscreenready: function (element, id) {
if (id == "main") {
var item = document.createElement('div');
item.setAttribute('data-bb-type','item');
item.setAttribute('data-bb-title','my title');
item.innerHTML = 'my description';
item.setAttribute('data-bb-img','foo.png');
document.getElementById('mylist').appendItem(item);
@nathanpc
nathanpc / index.html
Created May 27, 2012 14:35
Post: How To Setup And Use NativeControls In PhoneGap
<script src="phonegap-1.0.0.js" type="text/javascript" charset="utf-8"></script>
<script src="NativeControls.js" type="text/javascript" charset="utf-8"></script>
@nathanpc
nathanpc / show_tabbar.js
Created May 27, 2012 14:39
Post: How To Setup And Use NativeControls In PhoneGap
nativeControls.showTabBar();
nativeControls.showTabBarItems("books", "finished", "about");
nativeControls.selectTabBarItem("books");
@nathanpc
nathanpc / create_tab.js
Created May 27, 2012 14:39
Post: How To Setup And Use NativeControls In PhoneGap
nativeControls.createTabBarItem(
"books",
"Books",
"/www/tabs/book.png",
{"onSelect": function() {
// Do something
}}
);
@nathanpc
nathanpc / init.js
Created May 27, 2012 14:38
Post: How To Setup And Use NativeControls In PhoneGap
nativeControls = window.plugins.nativeControls;
nativeControls.createTabBar();
@nathanpc
nathanpc / simple_target_server.dart
Created April 15, 2012 13:34
Simple Target Server
#import("dart:io");
#import("Target.dart");
void main() {
var Target = new Target();
File script = new File(new Options().script);
script.directory((Directory d) {
Target.createServer(d.path + "/public", 8800);
@nathanpc
nathanpc / test.c
Created March 21, 2012 01:13
Playing With The PIC 12F629
#define _LEGACY_HEADERS
#include <pic.h>
#include <pic12f629.h>
__CONFIG(UNPROTECT & BORDIS & MCLRDIS & PWRTEN & WDTDIS & INTIO);
void delay(char value);
void d1();
@nathanpc
nathanpc / LICENSE.txt
Created February 24, 2012 04:25 — forked from aemkei/LICENSE.txt
Binary Tetris - 140byt.es
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Martin Kleppe <http://twitter.com/aemkei>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE