Skip to content

Instantly share code, notes, and snippets.

// put in console on http://higginsforpresident.net
dojo.addScript("http://www.buyog.com/code/misc/flip.js", function(){
dojo.query("p, h1, pre").flip();
});
// 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);
}

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
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);
dojo.declare("my.Thinger", null, {
oneDefault:"string",
anotherDefault:42, // number
constructor: function(href, additionalOptions){
// if additionalOptions is null, nothing happens:
dojo.mixin(this, additionalOptions);
}
// 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(){
<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 ...
dojo.declare('hitpost.Search', dijit._Widget, {
// not necessary:
// searchTimeout : null,
cache : {}, // NOTE: thisis a shared member, like a static. create it in postCreate
// if you want a unique cache for each instance. Otherwise, thisis fine.
// no need for a blank constructor
// constructor : function(args) { },
[2:34p] phiggins: paul_irish: so what
[2:34p] JohnResig: nlogax: V8 == delorean
[2:34p] phiggins: 's the significance between 1.3.3 and 1.4? jq puts enhancements in the dot releases? Oh there's JohnResig
[2:35p] ben_alman: lol
[2:35p] JohnResig: phiggins: API changes in major releases
[2:35p] nlogax: JohnResig: omg! so that's why my computer is suddenly using 1.21 jiggawatts
[2:35p] phiggins: so like back-compat changes?
[2:35p] JohnResig: phiggins: yep
[2:35p] miketaylr: once you hit 88 back clicks....
[2:35p] phiggins: interesting. so no forward support for 1.3.x users, they have to take the regressions
[2:34p] phiggins: paul_irish: so what
[2:34p] JohnResig: nlogax: V8 == delorean
[2:34p] phiggins: 's the significance between 1.3.3 and 1.4? jq puts enhancements in the dot releases? Oh there's JohnResig
[2:35p] ben_alman: lol
[2:35p] JohnResig: phiggins: API changes in major releases
[2:35p] nlogax: JohnResig: omg! so that's why my computer is suddenly using 1.21 jiggawatts
[2:35p] phiggins: so like back-compat changes?
[2:35p] JohnResig: phiggins: yep
[2:35p] miketaylr: once you hit 88 back clicks....
[2:35p] phiggins: interesting. so no forward support for 1.3.x users, they have to take the regressions