Skip to content

Instantly share code, notes, and snippets.

View jcemer's full-sized avatar
🐢
.

Jean Carlo Emer jcemer

🐢
.
View GitHub Profile
@jcemer
jcemer / CSS.js
Created August 6, 2012 00:22
Simple CSS prefixator, transform detection and translateX
// thanks to http://www.mobify.com/
var CSS = {
cache: {},
prefixes: ['Webkit', 'Moz', 'O', 'ms', ''],
getProperty: function(name) {
var div, property;
if (typeof CSS.cache[name] !== 'undefined') {
return CSS.cache[name];
}
@jcemer
jcemer / receita-federal.php
Created June 30, 2012 14:15
Receita Federal - CPF e CNPJ
<?php
/*
Cadastros da Receita Federal do Brasil
* Cadastro de Pessoas Físicas - CPF
* Cadastro Nacional Pessoa Jurídica - CNPJ
Por Jean Carlo Emer
*/
@jcemer
jcemer / gist:2889003
Created June 7, 2012 14:09
Coffeescript #troll
raf = 'RequestAnimationFrame'
window['r' + raf[1..]] ?= do ->
return R for pre in ['webkit', 'moz', 'ms', 'o'] when R = window[pre + raf]
# =.=.=.=.=.=.=.=.=.=.=.=.=.=
raf = 'RequestAnimationFrame';
if (window[_name = 'r' + raf.slice(1)] == null) {
window[_name] = (function() {
@jcemer
jcemer / icon.less
Created May 26, 2012 16:59
LessCSS optional over background
.icon(@i, @over:true) {
background-position: 0 @i*-@iconHeight;
}
.icon(@i, @over:true) when (@over) {
&:hover {
background-position: -@iconWidth @i*-@iconHeight;
}
}
.class1 { .icon(2) }
@jcemer
jcemer / Cakefile
Created May 26, 2012 12:32 — forked from ricardobeat/Cakefile
Simple Cakefile for LESS + CoffeeScript with file watching
{exec} = require 'child_process'
fs = require 'fs'
lastChange = {}
global.coffee = []
global.less = []
# CONFIGURATION
coffee.push 'main'
less.push 'main'
@jcemer
jcemer / dabblet.css
Created January 14, 2012 13:41
First attempt to make diagonal stripes
/**
* First attempt to make diagonal stripes
*/
background: linear-gradient(0deg, black 0%, #E96447 30%);
background-size: 100px 100px;
var vm = require('vm')
var sandbox = {externalArray: [], externalArryConstructor: Array}
vm.createContext(sandbox)
console.log(vm.runInContext('externalArryConstructor == Array', sandbox))
console.log(vm.runInContext('externalArray.constructor == Array', sandbox))
console.log(sandbox.externalArray.constructor == Array)
console.log(vm.runInContext('externalArray.__proto__ == [].__proto__', sandbox))
@jcemer
jcemer / add.js
Created July 8, 2014 19:09
Browserify sample
module.exports = function (a, b) {
return a + b;
};