Skip to content

Instantly share code, notes, and snippets.

🐢
.

Jean Carlo Emer jcemer

🐢
.
Block or report user

Report or block jcemer

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@jcemer
jcemer / add.js
Created Jul 8, 2014
Browserify sample
View add.js
module.exports = function (a, b) {
return a + b;
};
View Playing with node vm.js
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 / dabblet.css
Created Jan 14, 2012
First attempt to make diagonal stripes
View dabblet.css
/**
* First attempt to make diagonal stripes
*/
background: linear-gradient(0deg, black 0%, #E96447 30%);
background-size: 100px 100px;
@jcemer
jcemer / Cakefile
Created May 26, 2012 — forked from ricardobeat/Cakefile
Simple Cakefile for LESS + CoffeeScript with file watching
View Cakefile
{exec} = require 'child_process'
fs = require 'fs'
lastChange = {}
global.coffee = []
global.less = []
# CONFIGURATION
coffee.push 'main'
less.push 'main'
@jcemer
jcemer / icon.less
Created May 26, 2012
LessCSS optional over background
View icon.less
.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 / gist:2889003
Created Jun 7, 2012
Coffeescript #troll
View gist:2889003
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 / receita-federal.php
Created Jun 30, 2012
Receita Federal - CPF e CNPJ
View receita-federal.php
<?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 / CSS.js
Created Aug 6, 2012
Simple CSS prefixator, transform detection and translateX
View CSS.js
// 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 / robot.js
Created Dec 4, 2012 — forked from cezarsa/robot.js
Simple Wall Robot
View robot.js
var Robot = function(robot){
robot.turnLeft(robot.angle % 90);
robot.turnGunRight(90);
robot.clone();
this.direction = 1;
};
Robot.prototype.onIdle = function(ev) {
var robot = ev.robot;
robot.ahead(1);
if (robot.parentId) {
@jcemer
jcemer / gist:4324878
Created Dec 18, 2012
No country for old men
View gist:4324878
var x = 2
with ({x:3}) {
console.log(x)
}
You can’t perform that action at this time.