Skip to content

Instantly share code, notes, and snippets.

View tomwayson's full-sized avatar
💭
Rockin' the dad jeans

Tom Wayson tomwayson

💭
Rockin' the dad jeans
View GitHub Profile
@thollingshead
thollingshead / Dojo_Widget.sublime-snippet
Last active February 4, 2016 20:35
Sublime snippet for Dojo widget boilerplate.
<snippet>
<content><![CDATA[
define([
'dijit/_WidgetBase',
'dojo/_base/declare'
], function(
_WidgetBase,
declare
) {
@odoe
odoe / myservicespec.js
Created December 9, 2013 15:22
Sample of using Sinon to stub modules in Dojo AMD.
define([
'esri/tasks/FindTask',
'dojo/promise/Promise',
'widgets/search/searchservice'
], function(
FindTask,
Promise,
Widget) {
return describe('widgets/search/searchservice', function() {
<!-- This is a quick rundown of how I got geotagging working in Tumblr via javascript and some hacking. Its in use at http://jpinjapan.tumblr.com - I hope tumblr builds it into their site soon! -->
<!-- This has to go somewhere at the top of your page, inside your <head>, as javascript -->
<!-- It prepares the regular expression that finds the geo: tags inside your various tags -->
var geore = new RegExp(/^geo:(-?\d+\.\d+);(-?\d+\.\d+)$/)
<!-- You must alter every <div> containing a post to look like this: -->
<div class="post text" id="post-{PostID}">
<!-- This is so that the javascript can find the posts it needs to. Its a hack around my unfamiliarity with jQuery really. -->