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
  • Oncorithms Institute
  • Brasil
View GitHub Profile
@gre
gre / easing.js
Last active July 28, 2025 08:46
Simple Easing Functions in Javascript - see https://github.com/gre/bezier-easing
/*
* This work is free. You can redistribute it and/or modify it under the
* terms of the Do What The Fuck You Want To Public License, Version 2,
* as published by Sam Hocevar. See the COPYING file for more details.
*/
/*
* Easing Functions - inspired from http://gizma.com/easing/
* only considering the t value for the range [0, 1] => [0, 1]
*/
EasingFunctions = {
@felquis
felquis / IEImageRotate.js
Created March 8, 2012 20:55
Faz uns calculos para aplicar o Matrix e rotacionar elementos no Internet Explorer
// 08/03/2012, 16:59 - ICOMP
// Simple Rotate Elements in IE
// by @felquis
// Thanks for Lucio, Etiqueta
window.globalVars = {rotatePI : Math.PI * 2 / 360};
$(window).load(function(){
$('[data-rotate]').each(function(i, obj){
// Valor do deg
var $obj = $(obj),
rotate = $obj.css('transform').replace(/rotate\((\-?[0-9]{1,})deg\)/i, '$1'),
@netojoaobatista
netojoaobatista / String.prototype.soundex.js
Created March 22, 2012 18:00
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}
@antsa
antsa / placeholder.scss
Created March 23, 2012 12:00
Placeholder mixin for Sass
// Placeholder @mixin for Sass
//
// A mixin to style placeholders in HTML5 form elements.
// Includes also a .placeholder class to be used with a polyfill e.g.
// https://github.com/mathiasbynens/jquery-placeholder
// Requires Sass 3.2.
//
// Example usage (.scss):
//
// input {
@augustohp
augustohp / mocks.php
Created March 27, 2012 17:50 — forked from alganet/mocks.php
Next-gen mocks and stubs for PHP 5.4
<?php
use FooBar\Test\Mock;
// In the sample below, $mock expects the method "sayHelloTo" to be called one time
// with the parameter $name equals "Alexandre" and return "Hello Alexandre"
$mock = (new Mock('NamespaceVendor\\ClassName'))([
'sayHelloTo' => function($name="Alexandre") {
return "Hello Alexandre";
@netojoaobatista
netojoaobatista / jquery.unbindAll.js
Created April 20, 2012 15:11
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 ) {
@robotlolita
robotlolita / 0-source.coffee
Last active December 27, 2015 02:32
CoffeeScript parser absurdity
[
a: 1
, b: 2
, c: 3
]
[ a: 1
, b: 2
, c: 3
]
@herberthamaral
herberthamaral / class-tests.js
Created April 24, 2012 21:09
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:{
@netojoaobatista
netojoaobatista / Proxy.create.js
Created April 25, 2012 19:16
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.
*/
@diguinhorocks
diguinhorocks / PaypalRequest.php
Created April 29, 2012 09:45
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