Skip to content

Instantly share code, notes, and snippets.

View jbueza's full-sized avatar

Jaime Bueza jbueza

View GitHub Profile
dojo.provide("clubn.controller.CycleController");
dojo.declare("clubn.controller.CycleController", mojo.controller.Controller,
{
addObservers: function() {
this.addObserver(this, "onInit", "InitializeCycle", function(context, caller) {
return {
timeout: 6000
};
});
},
#!/usr/bin/env ruby
$: << ENV['TM_SUPPORT_PATH'] + '/lib'
require 'escape'
def esc(str)
e_sn(str).gsub(/\}/, '\\}') # escaping inside a placeholder
end
s = STDIN.read
if s.empty? then
print "<strike>$1</strike>"
function MyAddon:OnInitialize()
self.db = LibStub("AceDB-3.0"):New("NinjalistDB")
end
table.insert(self.db.global, "my data goes here")
for i,v in ipairs(self.db.global) do
print("Row: "..v)
end
google.pacman ||
function () {
var a = true,
e = false,
g = {},
i = [1, 4, 2, 8],
l = {
0: {
axis: 0,
increment: 0
<?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;