Skip to content

Instantly share code, notes, and snippets.

@Trindaz
Trindaz / gist:3735444
Created September 17, 2012 03:48
Inject JQuery to any webpage at runtime
var script=document.createElement('script');
script.attributes["src"]="http://code.jquery.com/jquery-latest.min.js"
var head=document.getElementsByTagName('head')[0];
head.appendChild(script);
@Trindaz
Trindaz / evented it tests (broken)
Last active December 10, 2015 20:48
evented it tests (broken)
var dgram = require('dgram');
var client_address = "0.0.0.0"
var client_port = 9002;
var server_address = "0.0.0.0"
var server_port = 9001
server_socket = dgram.createSocket('udp4');
server_socket.on('listening', function() { console.log("Server is listening"); });
var dgram = require('dgram');
var client_address = "0.0.0.0"
var client_port = 9002;
var server_address = "0.0.0.0"
var server_port = 9001
var maxWaitTimeForResponse = 6000;
describe("d1", function(){
function step1(){
describe("A test description", function(){
it("A test it", function(done){
step2();
done();
})
})
};
@Trindaz
Trindaz / Circular reference JSON.stringify wrapper
Created January 28, 2013 04:44
Circular reference JSON.stringify wrapper
var repeatingArray = [4, 5, 6];
var circularObj = {
a: 1,
b: 1,
c: "an allowed repeating string",
d: "an allowed repeating string",
e: repeatingArray,
f: repeatingArray,
g: [
info: Creating snapshot 0.0.0-12
debug: { method: 'POST',
debug: uri: 'https://api.nodejitsu.com/apps/trindaz/schema-website/snapshots/0.0.0-12',
debug: headers:
debug: { Authorization: '*****************************************************************',
debug: 'Content-Type': 'application/octet-stream',
debug: 'Content-Length': 838178 },
debug: timeout: 240000 }
info Uploading: [=============================] 100%
debug: { statusCode: 500,
info: Creating snapshot 0.0.0-13
info Uploading: [=============================] 100%
info: Updating app schema-website
info: Activating snapshot 0.0.0-13 for schema-website
info: Starting app schema-website
error: Error running command deploy
error: Nodejitsu Error (500): Internal Server Error
error:
error: There was an error while attempting to start the app
error: Error spawning drone
info: Creating snapshot 0.0.0-14
debug: { method: 'POST',
debug: uri: 'https://api.nodejitsu.com/apps/trindaz/schema-website/snapshots/0.0.0-14',
debug: headers:
debug: { Authorization: '*****************************************************************',
debug: 'Content-Type': 'application/octet-stream',
debug: 'Content-Length': 838180 },
debug: timeout: 240000 }
info Uploading: [=============================] 100%
debug: { statusCode: 201,
@Trindaz
Trindaz / gist:5275435
Created March 30, 2013 04:54
package.json for jcrugzz
{
"name": "schema-website",
"version": "0.0.0-30",
"description": "ERROR: No README.md file found!",
"main": "server.js",
"dependencies": {
"async": "~0.2.5",
"consolidate": "~0.8.0",
"express": "~3.1.0",
"passport": "~0.1.15",
<html>
<head>
<title>Side By Side Div Example</title>
<style>
div.left-column {
width: 20%;
min-width: 200px;
float: left;
background-color: yellow;