Skip to content

Instantly share code, notes, and snippets.

View jbueza's full-sized avatar

Jaime Bueza jbueza

View GitHub Profile
<?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
//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 });
// 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){
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;
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
<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 = {
@jbueza
jbueza / jquery.bovan.js
Created November 24, 2010 17:55
The Bovan Plugin lol
(function( $ ){
$.fn.bovan = function() {
console.log("hello, this is: ", this);
};
})( jQuery );
$(document).ready(function() {
@jbueza
jbueza / wtfcheck.js
Created November 25, 2010 12:27 — forked from bovan/wtfcheck.js
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;
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 is very dirty
(condition) ? function() {
//o yes!
}() : function() {
//o noes!
}();