Skip to content

Instantly share code, notes, and snippets.

View add urlacl.cmd
:: NOTE needs to be elevated
@set /p HTTP_PORT=Enter Port number [e.g. 10082]:
netsh http add urlacl url=http://*:%HTTP_PORT%/ user=everyone
netsh http add urlacl url=http://localhost:%HTTP_PORT%/ user=everyone
netsh http add urlacl url=http://%COMPUTERNAME%:%HTTP_PORT%/ user=everyone
netsh http add urlacl url=http://%COMPUTERNAME%.local:%HTTP_PORT%/ user=everyone
@pause
@davemo
davemo / jquery.touch.js
Last active Nov 2, 2016 — forked from twalling/jquery.touch.js
Zeptos touch events, ported to work inside jQuery, including jQuery Mobiles scroll suppression.
View jquery.touch.js
;(function($){
var touch = {},
touchTimeout, tapTimeout, swipeTimeout,
longTapDelay = 750, longTapTimeout
function parentIfText(node) {
return 'tagName' in node ? node : node.parentNode
}
function swipeDirection(x1, x2, y1, y2) {
@davemo
davemo / ios5webdebug.sh
Created Nov 13, 2012 — forked from sergiolopes/ios5webdebug.sh
Runs iOS 5 simulator with MobileSafari remote debug
View ios5webdebug.sh
#!/bin/bash
# Open iPhone Simulator on default location for XCode 4.3
open /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone\ Simulator.app
# Open mobile safari
echo Open mobile safari on emulator and press return
read
# Plug debug to MobileSafari.app
@davemo
davemo / jsconf_does_disney.md
Created Oct 6, 2012 — forked from jed/jsconf_does_disney.md
2012 JavaScript Roundup, Disney-style @ JSCONF EU 4ß
View jsconf_does_disney.md

Objective-C (to the tune of Under the Sea)

If you're shipping iOS apps,

and dream of the bucks you'll make,

you might think of "going native",

but Xcode's a big headache.

@davemo
davemo / gist:3093034
Created Jul 11, 2012 — forked from rmurphey/gist:3086328
What's wrong with Netmag's "Optimize your JavaScript" post
View gist:3093034

What's wrong with Netmag's "Optimize your JavaScript" post

Update: The original post on Netmag has been updated since this was written.

This is a response to an article posted on Net Magazine earlier this week that offers optimization tips for those writing JavaScript. Generally, these performance-related articles are inaccurate and harmful to new Front-End Developers trying to understand the craft -- there are many other things you should do to improve a page's performance before worrying about the purported perf hit of multiplication vs. division -- while the intention of this post may have been to inform and educate it did the opposite: it offered inaccurate advice.

A few of us have taken the time to assemble a list of corrections in the hope that Net Magazine will update the article and avoid lead

@davemo
davemo / some-source.js
Created May 19, 2011 — forked from searls/some-source.js
Add a little spy on creator that defaults to return this to support jQuery-like chaining.
View some-source.js
buttonifyAndHide = function($obj) {
$obj.button().hide();
};
View $.fn.outerHTML.js
/*
* Full example here: http://jsfiddle.net/jboesch26/3SKsL/1/
*/
$.fn.outerHTML = function(){
// IE, Chrome & Safari will comply with the non-standard outerHTML, all others (FF) will have a fall-back for cloning
return (!this.length) ? this : (this[0].outerHTML || (
function(el){
var div = document.createElement('div');
View gist:317201
$('form.section_edit_form').live('submit', function () {
var section_id = $(this).parent().attr('id').split("_")[1];
$.ajax({
url: "/wiki/ajax/section_edit/?section_id=" + section_id,
type: "POST",
data: $(this).serialize(),
success: function(data) {
$(this).parent().html(data);
}
View gist:317199
$('form.section_edit_form').live('submit', function () {
var section_id = $(this).parent().attr('id').split("_")[1];
$.ajax({
url: "/wiki/ajax/section_edit/?section_id=" + section_id,
type: "POST",
data: $(this).serialize(),
success: function(data) {
$(this).parent().html(data);
}
View gist:317198
$('form.section_edit_form').live('submit', function () {
var section_id = $(this).parent().attr('id').split("_")[1];
$.ajax({
url: "/wiki/ajax/section_edit/?section_id=" + section_id,
type: "POST",
data: $(this).serialize(),
success: function(data) {
$(this).parent().html(data);
}
You can’t perform that action at this time.