Skip to content

Instantly share code, notes, and snippets.

View luan03's full-sized avatar
🏠
Working from home

Software Development Engineer luan03

🏠
Working from home
View GitHub Profile
@luan03
luan03 / vue-quiz.md
Last active November 15, 2018 13:44
Take the 12-Factor Quiz

VueJS 12-Factor Quiz

1. Features

Score: A/B

  • Virtual DOM
  • Data Binding
  • Components
  • Event Handling
@luan03
luan03 / review.md
Created May 2, 2016 02:57 — forked from thomastheyoung/review.md
Javascript Templates Comparison: Hogan, dust, doT, underscore

JavaScript Templates Engines

A quick comparison/ benchmark between Hogan, Dust, doT and underscore

Presentation and Readability

Hogan.js

Developed by Twitter (same team as Bootstrap), use exactly the same syntax as Mustache, but more performant and more stuff available server side.

My name is {{ name }}

/*
Não sabemos o que tem dentro de "e" pode ser uma adição,
remoção ou ambos. O snippet abaixo funciona em todos os casos.
*/
Estado.atualizaEstado = function(e){
//Try to add a state;
try{
if(typeof(e.added.id) !== undefined){
Estado.selected.push(e.added.id);
@luan03
luan03 / gist:ccff36be87053b5a0fce
Last active August 29, 2015 14:08
Padrão javascript
/* Sempre chamar o javascript de um arquivo externo (Blocos na página nunca mais)
- partial view para os assigns do backend
recuperar os valores via javascript.
- incluir no bundle SEMPRE!!!
- Não deixar lixo no código (código comentado e funções não utilizadas)
*/
// Criar funções utilizando use strict. (apenas no escopo da função)
// Documentar o código [http://usejsdoc.org/]
@luan03
luan03 / gist:4f13241878a4f288d8c4
Last active August 29, 2015 14:05
Questões frontend
Questões javascript:
1 - Dado o array:
var Frutas = ["abacaxi", "maçã", "banana", "uva"];
como retorno o valor de maçã?
---------------------------------------------------------------------------------------------------------------------------------
@luan03
luan03 / methods.js
Last active January 26, 2016 01:15
métodos bastante utilizados no jquery para multiplas funções.
.add();
/* Add elements to the set of matched elements. */
map(); / each(); / filter();
is(); / not(); / has();
jQuery.inArray();
/* Search for a specified value within an array and return its index (or -1 if not found). */
{
//Mostrar os espaços em branco
"draw_white_space": "all",
// Tamanho da fonte default
"font_size": 11,
//Limitador de caracteres
"rulers": [80],
@luan03
luan03 / hint.js
Last active January 26, 2016 01:16
configuração basica jshint
/* global $:true, jQuery:true */
/* jshint strict:true, indent:4, maxlen:80, multistr:true, devel:true, browser:true */
/* This is a basic comment */
/* ==========================================================================
This is a Section Comment
========================================================================== */
/* ==========================================================================
This is a Sub-Section Comment
@luan03
luan03 / regex.md
Last active January 26, 2016 01:18
padrão basico de regex

Leia a ER átomo por átomo, da esquerda para a direita.

fala[r!]?

Um f seguido de um a, seguido de um l, seguido de um a, seguido de: ou r, ou !, ambos opcionais.

resultado = fala[r!]? falar, fala!, fala

curinga .* Teremos qualquer caractere, em qualquer quantidade. uma carta para se usar em qualquer situação.