Skip to content

Instantly share code, notes, and snippets.

View Mparaiso's full-sized avatar

mparaiso Mparaiso

View GitHub Profile
var request = require('supertest'),
should = require('should'),
app = require('../server');
var Cookies;
describe('Functional Test <Sessions>:', function () {
it('should create user session for valid user', function (done) {
request(app)
.post('/v1/sessions')
//
// toplevel.js
//
// TopLevel enables you to template your HTML, CSS, and Javascript at the Top Level
// (c) 2014 chris mckenzie. see LICENSE for more details.
// https://github.com/kristopolous/TopLevel for the latest version.
//
// Parts of this code use Jeremy Ashkenas' underscore library, available at
// https://github.com/jashkenas/underscore and protected by the license specified
// therein.
// Use absolute URLs to navigate to anything not in your Router.
// Only need this for pushState enabled browsers
if (Backbone.history && Backbone.history._hasPushState) {
// Use delegation to avoid initial DOM selection and allow all matching elements to bubble
$(document).delegate("a", "click", function(evt) {
// Get the anchor href and protcol
var href = $(this).attr("href");
var protocol = this.protocol + "//";
// Node.js CheatSheet.
// Download the Node.js source code or a pre-built installer for your platform, and start developing today.
// Download: http://nodejs.org/download/
// More: http://nodejs.org/api/all.html
// 0. Synopsis.
// http://nodejs.org/api/synopsis.html
@Mparaiso
Mparaiso / README.md
Last active August 29, 2015 14:06 — forked from mariocesar/README.md

Install

Create a websites user.

sudo adduser --disabled-password --home /src/websites websites

Login and install dropbox.

sudo -s su - websites

<?php
define('START_TIME', microtime(TRUE));
register_shutdown_function(function() {
print dump(round(microtime(TRUE) - START_TIME, 3) . ' seconds');
print dump(round(memory_get_peak_usage() / 1024) . " kb peak usage");
print dump(DB::$q);
});
@Mparaiso
Mparaiso / go_scp.go
Last active August 29, 2015 14:18 — forked from jedy/go_scp.go
// https://blogs.oracle.com/janp/entry/how_the_scp_protocol_works
package main
import (
"fmt"
"golang.org/x/crypto/ssh"
)
const privateKey = `content of id_rsa`
@Mparaiso
Mparaiso / apiexamples.js
Created May 9, 2012 01:44 — forked from jrburke/apiexamples.js
Description of browser-friendly module APIs: AMD and Loader Plugins
//*******************************************
// Level 1, basic API, minimum support
//*******************************************
/*
Modules IDs are strings that follow CommonJS
module names.
*/
//To load code at the top level JS file,
//or inside a module to dynamically fetch
@Mparaiso
Mparaiso / jquery-pubsub.js
Created May 16, 2012 04:13 — forked from bentruyman/jquery-pubsub.js
Simple Pub/Sub Implementation for jQuery
/*
* Simple Pub/Sub Implementation for jQuery
*
* Inspired by work from Peter Higgins (https://github.com/phiggins42/bloody-jquery-plugins/blob/master/pubsub.js)
*
* This is about the simplest way to write a pubsub JavaScript implementation for use with jQuery.
*/
(function( $ ) {
// Cache of all topics