Skip to content

Instantly share code, notes, and snippets.

View erkobridee's full-sized avatar

Erko Bridee erkobridee

View GitHub Profile
@erkobridee
erkobridee / grunt_wf_read_links
Last active August 29, 2015 13:55
leitura de links para revisar e otimizar os fluxos de desenvolvimento com Grunt.js
@erkobridee
erkobridee / frontend_ambiente_dev.md
Created February 4, 2014 12:51
dica para montar o ambiente de desenvolvimento frontent

Ambiente de Desenvolvimento

Suporte a codificação

Uma linha de comando melhor para Windows

msysgit - ferramental de git para o windows, o qual inclui um terminal POSIX (mais na linha dos sistemas UNIX/Linux) que o MSDOS nativo do Windows

Materiais de apoio sobre sistema de controle de versão

@erkobridee
erkobridee / Preference.sublime-settings
Created August 22, 2015 01:49
sublime text preference settings
{
"color_scheme": "Packages/Tomorrow Color Schemes/Tomorrow-Night-Eighties.tmTheme",
"default_encoding": "UTF-8",
"draw_indent_guides": true,
"draw_white_space": "all",
"findreplace_small": true,
"font_face": "Monaco",
"font_options":
[
"no_round"
@erkobridee
erkobridee / dateDiff.as
Created January 31, 2012 12:57
[AS3] Calculo da diferença entre 2 datas
public static function dateDiff( date1:Date, date2:Date ) : String {
// calculando a diferença em milisegundos das datas
var sec:Number = date2.getTime() - date1.getTime();
// verificando se a segunda data é inferior que a primeira
if( sec < 0 ) {
Alert.show( "The second date ocurred earlier than the first one!" );
return null;
}
@erkobridee
erkobridee / loop.py
Created February 1, 2012 01:41
Curiosidades sobre loops no python
'''
Curiosidades do Python e estruturas de loop
uma delas temos a funcao range a qual nos possibilita criar um array
facilmente...
ex.:
arr = range(10)
@erkobridee
erkobridee / aumento_reducao_percentual.py
Created February 1, 2012 01:56
um calculo simples que usei para realizar ajustes nas dimensões de imagens
import math
def aumentoPercentual(valorInicial, valorPercentual):
resultado = math.ceil( valorInicial * valorPercentual )
return valorInicial + resultado
def reducaoPercentual(valorInicial, valorPercentual):
resultado = math.ceil( valorInicial * valorPercentual )
return valorInicial - resultado
@erkobridee
erkobridee / fatorial_combinacao.py
Created February 1, 2012 15:49
Algoritmo matemático para calcular fatorial (com limite) e combinação
def fatorial(n, limite=1):
if n == 0 or n == 1:
return 1 #por definição 0! ou 1! = 1
if limite < 1 or limite >= n:
return -1 #representando valor incorreto
else :
fatArr = range(limite,n+1)
resultado = 1
for i in fatArr:
resultado = resultado * i
@erkobridee
erkobridee / really_elementary.py
Created February 3, 2012 12:38
um dos desafios do site rankk.org
'''
Really elementary
A box contains some buttons.
1/4 of them are black,
1/8 of them are red,
and the rest are white.
There are 636 more white buttons than red buttons.
How many buttons are there altogether?
@erkobridee
erkobridee / binarySum.py
Created February 3, 2012 12:32
um dos desafios do site rankk.org
def binaryStringCalc(strValue):
result = 0
for v in strValue.split(' + '):
result += int(v,2)
return str(bin(result)).split('0b')[1]
print binaryStringCalc('110000001 + 100111001 + 100101000 + 10000011 + 111010001')