Skip to content

Instantly share code, notes, and snippets.

View suissa's full-sized avatar
🏠
Working from home

Jean Carlo Nascimento suissa

🏠
Working from home
  • Suissa Corp
  • Brasil
View GitHub Profile
@suissa
suissa / class-tests.js
Created April 25, 2012 17:47 — forked from herberthamaral/class-tests.js
Simple, but effective JavaScript class system
describe("class system", function(){
it("should be possible to create classes", function(){
Class({name:'MyClass'});
expect(window.MyClass === undefined).toBeFalsy();
});
it("should be possible to create properties within classes", function(){
Class({
name:'MyClass',
attrs:{
@suissa
suissa / Proxy.create.js
Created April 25, 2012 21:50 — forked from netojoaobatista/Proxy.create.js
Exemplo simples de uso da API antiga de ECMAScript Proxy
/**
* Um objeto de origem qualquer
*/
var o = { x: 10, y: 10 };
/**
* Criação do Proxy (API antiga).
* Cada uma dessas propriedades do proxy representa uma operação no objeto de origem; O proxy
* receberá a operação e delegará (ou não) para o objeto de origem.
*/
@suissa
suissa / jquery.unbindAll.js
Created April 25, 2012 21:51 — forked from netojoaobatista/jquery.unbindAll.js
Remove todos os manipuladores de eventos que foram anexados aos elementos
/**
* Removes all previously-attached event handlers from the elements.
*/
$.fn.unbindAll = function() {
var events = $(this).data('events');
return this.each( function() {
var $this = $(this);
for ( var evt in events ) {
@suissa
suissa / String.prototype.soundex.js
Created April 25, 2012 21:51 — forked from netojoaobatista/String.prototype.soundex.js
Implementação do algorítimo SoundEX em Javascript
/**
* Implementação do algorítimo SoundEx em Javascript.
* @author João Batista Neto
*
* SoundEX é um algorítimo fonético para indexação de nomes pelo som segundo
* sua pronúncia. O algorítimo foi desenvolvido por Robert C. Russell e
* Margaret K. Odell e patenteado em 1918 e 1922.
* {@link http://en.wikipedia.org/wiki/Soundex}
*
* @return {String}
@suissa
suissa / index.html
Created April 27, 2012 12:56
Anything Slider
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>AnythingSlider Video Demo</title>
<link rel="shortcut icon" href="demos/images/favicon.ico">
<link rel="apple-touch-icon" href="demos/images/apple-touch-icon.png">
@suissa
suissa / PaypalRequest.php
Created May 5, 2012 22:25 — forked from diguinhorocks/PaypalRequest.php
PaypalRequest Class (Express Checkout)
<?php
/**
*
* Paypal Request Class.
*
* Classe que adiciona os produtos e cria a requisição para a API Paypal utilizando o Express Checkout.
*
* @author R'Santiago.
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
@suissa
suissa / IndexDB-demo3.html
Created May 20, 2012 06:18 — forked from greenido/IndexDB-demo3.html
IndexDB demo for MDC day (Chrome 12+ and FF4+)
<!DOCTYPE html>
<html>
<head>
<title>IndexDB Demo - Version 1.1</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta name="author" content="Ido Green"/>
</head>
<style>
#footer {
background-color: yellowgreen;
@suissa
suissa / portscan.js
Created August 6, 2012 14:46 — forked from kaiquewdev/portscan.js
A port scan with node.js ( by Hacksparrow <http://www.hacksparrow.com> )
#!/usr/bin/env node
var net = require('net'),
host = 'localhost',
start = 1,
end = 10000,
timeout = 15000;
while ( start <= end ) {
var port = start;
@suissa
suissa / gist:3342377
Created August 13, 2012 16:30 — forked from kaiquewdev/gist:2655801
PhantomJS Screenshot
var page = new WebPage(),
address, output, size;
address = "http://www.metachunk.com/";
width = 1024; height = 600;
output = "./screenshots/wat-"+width+"X"+height+".png";
page.viewportSize = { width: width, height: height };
if (phantom.args.length === 3 && phantom.args[1].substr(-4) === ".pdf") {
@suissa
suissa / MongoActiveRecord.php
Created August 16, 2012 19:22 — forked from diguinhorocks/Client.php
MongoDB Active Record (Basic)
<?php
require_once('MongoFactory.php');
class MongoActiveRecord extends MongoFactory{
private $model;
private $statement;
private $class;
private $className;