Skip to content

Instantly share code, notes, and snippets.

View scothis's full-sized avatar

Scott Andrews scothis

View GitHub Profile
dojo.provide("dojox.charting.axis2d.Titled");
dojo.require("dojox.charting.axis2d.Default");
dojo.require("dojox.gfx");
dojo.require("dojox.gfx.matrix");
(function(){
var dc = dojox.charting,
g = dojox.gfx,
m = dojox.gfx.matrix,
@scothis
scothis / gist:945753
Created April 28, 2011 03:39
cloudfoundry-runtime
<repositories>
<repository>
<id>org.springframework.milestone</id>
<name>Spring Framework Milestone Repository</name>
<url>http://maven.springframework.org/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
<releases>
<updatePolicy>never</updatePolicy>
<rule>
<from>^/flowers/(.*)$</from>
<to>/$1</to>
</rule>
<c:url value="/" var="baseURL" />
@scothis
scothis / serv.js
Created November 14, 2011 18:50
Serve static HTTP requests from any directory
// alias serv="node path/to/serv.js"
var http = require('http'),
express = require('express'),
path = process.env.PWD,
port = process.argv[2] || 8000,
app = express.createServer();
app.configure(function(){
@scothis
scothis / gist:1760342
Created February 7, 2012 15:49
Quick and dirty Gradle task for deploying Cloud Foundry
buildscript {
repositories {
mavenCentral()
maven { url 'http://maven.springframework.org/milestone' }
}
dependencies {
classpath 'org.cloudfoundry:cloudfoundry-client-lib:0.7.1'
}
}
@scothis
scothis / gist:2884321
Created June 6, 2012 19:53
toHulkCase
String.prototype.toHulkCase = function(str) {
   return 'HULK SMASH PUNY ' + str.toUpperCase() + ' ARRRRRRRRRRRRR';
}
@scothis
scothis / lazyPromise.js
Last active December 20, 2015 04:49
Creates a lazy promise that only starts its work once there is interest in the outcome
var when = require('when'),
whenFn = require('when/function');
function lazyPromise(work) {
var defer, started, resolver, promise, then;
defer = when.defer();
started = false;
resolver = defer.resolver;
@scothis
scothis / zoom.js
Last active May 26, 2020 23:01
Cesium.js zoom to camera
var eventHandler, mousePosition;
viewer.scene.screenSpaceCameraController.enableZoom = false;
eventHandler = new ScreenSpaceEventHandler(viewer.scene.canvas);
eventHandler.setInputAction(function (event) {
mousePosition = event.endPosition;
}, ScreenSpaceEventType.MOUSE_MOVE);
eventHandler.setInputAction(function (wheelZoomAmount) {