Skip to content

Instantly share code, notes, and snippets.

View edudobay's full-sized avatar

Eduardo Dobay edudobay

View GitHub Profile
@edudobay
edudobay / linguagem-funcional.rst
Last active August 29, 2015 14:07
linguagem funcional

linguagem funcional

qual a definição de fatorial? um matemático poderia me responder algo assim:

fatorial(1) = 1
fatorial(n :: n Inteiro, n > 1) = n * fatorial(n-1)

como eu represento isso numa linguagem de programação? se você está acostumado com linguagens imperativas, poderia escrever um programa desse tipo:

CSS

Textos-guia em geral

  • http://learn.shayhowe.com/html-css/ — guia bastante detalhado sobre HTML e CSS (principalmente CSS). Pelo que vi parece um ótimo material.
  • http://www.theodinproject.com/ — um projeto inteiro voltado para aprender todo tipo de programação web (inclusive backend, usando Ruby). É um compêndio de links para diversos materiais diferentes, mas organizado na forma de um curso, com a preocupação de estabelecer bem os fundamentos e de escolher materiais BONS. Recomendo fazer a inscrição e dar uma olhada nas partes sobre CSS — tem uma seção introdutória [1: Introduction to Web Development] e uma continuação [5: HTML5 and CSS3].
  • http://it-ebooks.info/book/3336/ — não sei se esse livro é realmente bom mas achei ele lindo :P

Sites de artigos + Referências diversas

@edudobay
edudobay / java.md
Last active February 15, 2016 13:40
Notes about Java

Useful libraries

  • RxJava - reactive programming (see also Introduction to ReactiveX)
  • Dagger - dependency injection (note: this is the Google fork (version 2). Version 1 is maintained by Square and seems to be still alive)
  • Gson - JSON (de)serialization to/from Java objects

Database, persistence, etc.

Keybase proof

I hereby claim:

  • I am edudobay on github.
  • I am edudobay (https://keybase.io/edudobay) on keybase.
  • I have a public key ASDbROyO0asRhHnBlKOiDl69yN_7KiOl2mumL5AKpLiHXgo

To claim this, I am signing this object:

@edudobay
edudobay / progfun1-week3.md
Last active August 9, 2016 21:44
Functional Programming with Scala - Course notes

Week 3: Object-Oriented Sets

Note about union performance/complexity

(Taken from the discussion forums)

def union1(that: TweetSet): TweetSet = right.union(left.union(that)).incl(elem)
def union2(that: TweetSet): TweetSet = right.union(that).union(left).incl(elem)
def union3(that: TweetSet): TweetSet = right.union(left.union(that.incl(elem)))
@edudobay
edudobay / 0_reuse_code.js
Created August 10, 2016 16:35
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console

Linux

Obtendo ajuda

  • manual: man ALGUMACOISA ─ disponível para a maioria dos comandos, e também para alguns arquivos de configuração
    • aperte q (quit) para sair
@edudobay
edudobay / to_string_builder.py
Created March 22, 2017 20:46
Simple "ToStringBuilder" for Python
def to_string_builder(obj, fields, filters={}):
return '<{name}({fields})>'.format(
name=type(obj).__name__,
fields=', '.join(
'{}={!r}'.format(name, value)
for name, value, predicate in
((name, getattr(obj, name), filters.get(name)) for name in fields)
if predicate is None or predicate(value)),
)
@edudobay
edudobay / EnumValue.kt
Last active November 4, 2017 16:37
Kotlin reified types issue
enum class Gender {
MALE, FEMALE
}
inline fun <reified T : Enum<T>> wrapEnumValueOf(name: String) = enumValueOf<T>(name)
inline fun postInline(block: () -> Unit) = block()
fun post(block: () -> Unit) = block()
@edudobay
edudobay / StateMachine.kt
Created January 15, 2018 20:22
RxJava state machine
package example
import io.reactivex.Observable
import io.reactivex.disposables.Disposable
import io.reactivex.functions.BiFunction
import io.reactivex.subjects.BehaviorSubject
import java.util.concurrent.TimeUnit
import kotlin.concurrent.thread
enum class InternalState { ON, OFF, GOING_ON, GOING_OFF }