Skip to content

Instantly share code, notes, and snippets.

View fernandofleury's full-sized avatar
🐊
vrau

Fernando Fleury fernandofleury

🐊
vrau
View GitHub Profile
(function(){
'use strict'
angular.module('app.module', []);
})();
@fernandofleury
fernandofleury / .jshintrc
Created February 2, 2015 01:47
.jshintrc
{
"bitwise": true,
"browser": true,
"camelcase": true,
"curly": true,
"eqeqeq": true,
"esnext": true,
"globals": {},
"immed": true,
"indent": 2,
$.fn[name] = function(options) {
options = options || {};
return this.each(function() {
if (!$.data(this, name)) {
$.data(this, name, new name(this, options))
}
});
};
import postcss from 'postcss';
import fs from 'fs';
export default (glyphs) => {
let stylesheet = postcss.root();
glyphs.forEach((glyph) => {
@fernandofleury
fernandofleury / component.all.js
Created February 3, 2016 14:36
component handling javascript
import emitter from '../utils/emitter';
const foo = (element) => {
let result = element.querySelector('[data-all="result"]');
let counter = 0;
emitter.on('counter', () => result.innerHTML = ++counter);
};
@fernandofleury
fernandofleury / .vimrc
Created February 23, 2016 20:42
.vimrc
set nocompatible
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
Plugin 'vim-airline/vim-airline'
Plugin 'vim-airline/vim-airline-themes'
import throttle from '../utils/throttle';
export default (($) => {
const NAME = 'lazyload';
const DEFAULTS = {
throttle: 1000,
offset: 200
};
class LazyLoad {
const animationFrame = timestamp => {
if (!this.startTime) {
this.startTime = timestamp;
}
this.delta = timestamp - this.startTime;
if (this.delta >= updateDiff) {
this.update(this.delta);
this.startTime = 0;