Skip to content

Instantly share code, notes, and snippets.

View fernandofleury's full-sized avatar
🐊
vrau

Fernando Fleury fernandofleury

🐊
vrau
View GitHub Profile
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;
import throttle from '../utils/throttle';
export default (($) => {
const NAME = 'lazyload';
const DEFAULTS = {
throttle: 1000,
offset: 200
};
class LazyLoad {
@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'
@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);
};
import postcss from 'postcss';
import fs from 'fs';
export default (glyphs) => {
let stylesheet = postcss.root();
glyphs.forEach((glyph) => {
$.fn[name] = function(options) {
options = options || {};
return this.each(function() {
if (!$.data(this, name)) {
$.data(this, name, new name(this, options))
}
});
};
@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,
(function(){
'use strict'
angular.module('app.module', []);
})();
.state('client.details', {
url: '/:idClient'
})
// gera url /10
.state('client.details.tasks', {
url:'/tasks'
})
// gera url /10/tasks
(function() {
'use strict';
angular.module('cbApp.service.clickbus', [])
.factory('clickbusApi', clickbusApi);
clickbusApi.$inject = ['$http', '$sessionStorage', 'parameters'];
function clickbusApi($http, $sessionStorage, parameters) {
return {