Skip to content

Instantly share code, notes, and snippets.

View jcemer's full-sized avatar
🐢
.

Jean Carlo Emer jcemer

🐢
.
View GitHub Profile
@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;
@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 / 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 / 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 / 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:3130835
Created July 17, 2012 17:55
Less gradient mixins
#gradient {
.vertical(@startColor: #555, @endColor: #333, @colorStop: 100%) {
background-color: mix(@startColor, @endColor, 60%);
background-image: -moz-linear-gradient(top, @startColor, @endColor @colorStop); // FF 3.6+
background-image: -ms-linear-gradient(top, @startColor, @endColor @colorStop); // IE10
background-image: -webkit-gradient(linear, 0 0, 0 @colorStop, from(@startColor), to(@endColor)); // Android 2.3, Safari 4+, Chrome 2+
background-image: -webkit-linear-gradient(top, @startColor, @endColor @colorStop); // Safari 5.1+, Chrome 10+
background-image: -o-linear-gradient(top, @startColor, @endColor @colorStop); // Opera 11.10
background-image: linear-gradient(top, @startColor, @endColor @colorStop); // The standard
}
@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 / grid.styl
Created September 18, 2012 00:00
A semantic.gs working stylus file
// .-. .-. .-. .-.
// Semantic.gs // for Stylus: http://learnboost.github.com/stylus/
// .-. .-. .-. .-.
// Defaults which you can freely override
$columnwidth = 60
$gutterwidth = 20
$columns = 12
gridwidth($c = $columns)
@jcemer
jcemer / robot.js
Created December 4, 2012 16:54 — forked from cezarsa/robot.js
Simple Wall Robot
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 December 18, 2012 03:59
No country for old men
var x = 2
with ({x:3}) {
console.log(x)
}