Skip to content

Instantly share code, notes, and snippets.

<html>
<head>
<title>Testing JSON parsing</title>
<script src="trunk/dojo/dojo.js"></script>
<script>
// setup the content-handler to use dojox.secure.capability or native JSON.parse
dojo._contentHandlers.json = (function(d){
// sanity check, load the module ...
// some non-working in-theory code
dojo.declare("Tabs", dijit._Widget, {
postCreate:function(){
this.controller = dojo.create("ul");
dojo.place(this.conroller, this.domNode, "before");
this._scanChildren();
},
_scanChildren: function(){
dojo.declare("my.Thinger", null, {
oneDefault:"string",
anotherDefault:42, // number
constructor: function(href, additionalOptions){
// if additionalOptions is null, nothing happens:
dojo.mixin(this, additionalOptions);
}
var foo = [1,2,3];
for(var i = 0; i < foo.length; i++){
(function(el, i){
})(foo[i], i, foo);
}
my.each = function(ar, fn, obj){
for(var i = 0; i < ar.length; i++){
fn.apply(obj || window, ar[i], i, ar);

HOWTO: iPhone AT&T Tethering

In 10 steps:

  • Update iTunes to 8.2 via Software Update
  • Update your iPhone to the 3.0 release (out today - June 17th)
  • Download this dmg and mount it: tethering file
  • Enable hidden carrier testing option (in Terminal.app): defaults write com.apple.iTunes carrier-testing -bool TRUE
  • Start up iTunes
// test a value for spaces, reduce a value to no spaces.
var re = / /g, value = "Some text with spaces";
if(value.test(re)){
var t = value.replace(re,"");
console.log(t.length);
}
// put in console on http://higginsforpresident.net
dojo.addScript("http://www.buyog.com/code/misc/flip.js", function(){
dojo.query("p, h1, pre").flip();
});