Skip to content

Instantly share code, notes, and snippets.

View lcezermf's full-sized avatar

Luiz Cezer lcezermf

View GitHub Profile
@lcezermf
lcezermf / 1.srp.py
Created May 12, 2021 15:09 — forked from dmmeteo/1.srp.py
SOLID Principles explained in Python with examples.
"""
Single Responsibility Principle
“…You had one job” — Loki to Skurge in Thor: Ragnarok
A class should have only one job.
If a class has more than one responsibility, it becomes coupled.
A change to one responsibility results to modification of the other responsibility.
"""
class Animal:
def __init__(self, name: str):
@lcezermf
lcezermf / main.go
Created December 7, 2017 00:11 — forked from mschoebel/main.go
Snippet: login/logout (Golang)
package main
import (
"fmt"
"github.com/gorilla/mux"
"github.com/gorilla/securecookie"
"net/http"
)
// cookie handling
@lcezermf
lcezermf / chat.go
Created April 8, 2016 00:56 — forked from cryptix/chat.go
simple chat example in go. uses channels to match partners and goroutines for concurency
package main
import (
"fmt"
"io"
"log"
"net"
)
const listenAddr = "localhost:4000"
@lcezermf
lcezermf / gist:b462b7048ef85b486836
Last active September 3, 2015 15:50 — forked from mattconnolly/gist:4158961
RSpec basic authentication helper module for request and controller specs
module AuthHelper
def http_login
user = 'username'
pw = 'password'
request.env['HTTP_AUTHORIZATION'] = ActionController::HttpAuthentication::Basic.encode_credentials(user,pw)
end
end
module AuthRequestHelper
#
FILE = Monografia
.PHONY: default
default: main clean
#por clean acima
.PHONY: main
main:
pdflatex $(FILE).tex
bibtex $(FILE).aux