This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<!-- | |
Licensed to the Apache Software Foundation (ASF) under one or more | |
contributor license agreements. See the NOTICE file distributed with | |
this work for additional information regarding copyright ownership. | |
The ASF licenses this file to You under the Apache License, Version 2.0 | |
(the "License"); you may not use this file except in compliance with | |
the License. You may obtain a copy of the License at | |
http://www.apache.org/licenses/LICENSE-2.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//assign an observer to the submit button of the ajax form | |
this.addObserver("#btn-submit", "onclick", "Submit"); | |
//only if we're passed validation, we show the overlay to display a request indicator | |
this.addObserver(this.getCommand("ValidateRules"), "onResponse", "ShowOverlay", { show: true }); | |
// | |
this.addObserver(this.getCommand("Submit"), "onComplete", "ShowOverlay", { show: false }); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// socket.io | |
var socket = io.listen(app); | |
var buffer = []; | |
socket.on('connection', function(client){ | |
client.send({ buffer: buffer }); | |
client.broadcast({ announcement: client.sessionId + ' connected' }); | |
client.on('message', function(message){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var http = require('http'), | |
url = require('url'), | |
fs = require('fs'), | |
// io = require('../'), | |
io = require('socket.io'), | |
sys = require('sys'), | |
server = http.createServer(function(req, res){ | |
// your normal server code | |
var path = url.parse(req.url).pathname; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dojo.provide("stdlib.command.MapControllersCommand"); | |
dojo.require("mojo.command.Command"); | |
dojo.declare("stdlib.command.MapControllersCommand", mojo.command.Command, { | |
execute: function(requestObj) { | |
var contextObj = null; | |
if(requestObj.getParams()) { | |
// parameters: contextObj: String or HTMLElement |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="map_canvas" style="width: 400px; height: 600px"></div> | |
<script type="text/javascript"> | |
jQuery(document).ready(function($){ | |
// load the data | |
$.getScript('js/store.js', function() { | |
//this gets invoked after store.js loads | |
var myLatlng = new google.maps.LatLng(65.000, 16.500 ); | |
var myOptions = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function( $ ){ | |
$.fn.bovan = function() { | |
console.log("hello, this is: ", this); | |
}; | |
})( jQuery ); | |
$(document).ready(function() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var data = $(document.body).data('trafikk'); | |
$(data).each(function(index, value){ | |
// filter function | |
$(data[index].ActualCounties).each(function(i, county){ | |
// if road is in more than 1 county, iterate | |
if(!$.isArray(county.String )) county.String = [count.String]; | |
data[index].include = (filter.indexOf(county.String.join()) < 0) ? false: true; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var express = require('express') | |
var app = express.createServer(); | |
var contentHash = {'sha1:content' : 'your mom'}; | |
app.configure(function() { | |
app.use(express.methodOverride()) | |
app.use(express.bodyDecoder()) | |
app.use(app.router) | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//this is very dirty | |
(condition) ? function() { | |
//o yes! | |
}() : function() { | |
//o noes! | |
}(); |