Skip to content

Instantly share code, notes, and snippets.

View sembug's full-sized avatar
💭
Development

Roberto Nunes sembug

💭
Development
View GitHub Profile
@sembug
sembug / go-notes.md
Last active March 31, 2025 23:53
Go Notes
type car struct {
  brand string
  model string
}

type truck struct {
  car
  bedSize int
}
@sembug
sembug / ERMermaid.md
Created March 10, 2025 17:46
ER Mermaid
erDiagram
    CUSTOMER }|..|{ DELIVERY-ADDRESS : has
    CUSTOMER ||--o{ ORDER : places
    CUSTOMER ||--o{ INVOICE : "liable for"
    DELIVERY-ADDRESS ||--o{ ORDER : receives
    INVOICE ||--|{ ORDER : covers
    ORDER ||--|{ ORDER-ITEM : includes
    PRODUCT-CATEGORY ||--|{ PRODUCT : contains
 PRODUCT ||--o{ ORDER-ITEM : "ordered in"
@sembug
sembug / ex_javascript_pt_br.md
Last active April 25, 2021 12:26
Exercícios de Javascript

Cifra de Cesar

Uma das cifras mais simples e mais conhecidas é a cifra de César, também conhecida como cifra de deslocamento.

Em uma cifra de deslocamento, os significados das letras são alterados por uma determinada quantidade.

Um uso moderno comum é a cifra ROT13, onde os valores das letras são deslocados em 13 casas.

Assim, 'A' vira 'N', 'Z' vira 'M' e assim por diante.

@sembug
sembug / add.sh
Last active March 27, 2021 11:00 — forked from gparlakov/add.sh
Add angular apps of a specific version
#Angular 2:the last RC version before switching to angular 4 as far as I can tell — based on this and the next version now depends on angular
npx -p @angular/[email protected] ng new angular2app
#Angular 4: the last CLI version before angular 5
npx -p @angular/[email protected] ng new angular4app
#Angular 5: the last CLI version before 6
npx -p @angular/[email protected] ng new angular5app
#Angular 6: the last CLI version before 7
@sembug
sembug / CleverCountLetters.js
Created February 7, 2021 12:15
CleverCountLetters.js
// https://twitter.com/Al_Grigor/status/1357028887209902088
/*
Most candidates cannot solve this interview problem:
Input: "aaaabbbcca"
Output: [("a", 4), ("b", 3), ("c", 2), ("a", 1)]
Write a function that converts the input to the output
I ask it in the screening interview and give it 25 minutes
@sembug
sembug / Antonyms.md
Created May 12, 2020 14:39 — forked from maxtruxa/Antonyms.md
A list of common terms used in programming and their respective antonyms.

Antonym List

Note: The table headings (positive/negative) are not necessarily meaningful.

Positive Negative
acquire release
add remove (e.g. an item), subtract (arithmetic)
advance retreat
allocate deallocate (correct), free (common)
allow deny
@sembug
sembug / README.md
Created March 5, 2020 13:59
Todo List

Features

  • [] Adding a single todo
  • [] Clearing the list
  • [] Marking and deleting a single todo
@sembug
sembug / InstantPython.md
Last active June 25, 2020 00:36
Instant Python

Python Instantâneo

por Magnus Lie Hetland

Este é um curso intensivo mínimo para a linguagem de programação Python. Para aprender mais, veja a documentação no site www.python.org; especialmente o tutorial. Se você está se perguntando porque deveria se interessar, veja esta comparação entre o Python e outras linguagens.

Esta introdução tem recebido elogios de leitores satisfeitos, e está sendo traduzida para vários idiomas, entre os quais russo, norueguês, português (esta página!) e espanhol. A versão original, em inglês, está aqui.

1. O básico

Para começar, pense em Python como sendo pseudo-código. Isto é quase uma verdade. Variáveis não têm tipos, assim você não precisa declará-las. Elas são criadas quando você lhes atribui um valor, e são destruídas quando não forem mais usadas. A atribuição é feita pelo operador =. A igualdade é testada com o operador ==. Você pode atribuir mais de uma variável ao m

@sembug
sembug / Program.cs
Last active February 27, 2020 13:55
AngularWebSocket
using SuperWebSocket;
using System;
using System.Threading;
namespace ConsoleWebSocket
{
public class Program
{
private static WebSocketServer webSocketServer;
public static void Main(string[] args)