Skip to content

Instantly share code, notes, and snippets.

View jeffprestes's full-sized avatar

Jeff Prestes jeffprestes

View GitHub Profile
@jeffprestes
jeffprestes / gitautocomplete.sh
Created January 5, 2016 21:16
Git Autocomplete
### git autocomplete
source ~/.git-completion.bash
source ~/.git-prompt.sh
export GIT_PS1_SHOWDIRTYSTATE=true
export GIT_PS1_SHOWUNTRACKEDFILES=true
export GIT_PS1_SHOWCOLORHINTS=true
export PROMPT_COMMAND='__git_ps1 "\w" "\\\$ "'
@jeffprestes
jeffprestes / cardarray.java
Last active March 18, 2016 15:13
Card Array in Java
package br.com.novatrix.cardarray;
/**
*
* @author jprestes
*/
public class Cards {
//The Card class has 2 arrays: Rank and Suit
@jeffprestes
jeffprestes / WhyILikeGo.md
Last active August 8, 2017 14:57 — forked from freeformz/WhyILikeGo.md
Why I Like Go

Porque gosto de Go

Vou a muitos eventos de desenvolvedores em geral, muitos estranham a minha motivação tão grande por Go e me fazem essa pergunta. Daí encontrei o artigo do Freeformz e achei a ideia de deixar isso no Github muito boa. Ao ler o artigo dele encontrei muitas coisas que concordo então resolvi fazer um fork e escrever a versão em português. O intuíto é deixar claro as vantagens de Go e ajudar desenvolvedores a convencerem seus gerentes e outros colaboradores a iniciarem a adoção de Go.

Goroutines

The first 1/2 of Go's concurrency story. Lightweight, concurrent function execution. You can spawn tons of these if needed and the Go runtime multiplexes them onto the configured number of CPUs/Threads as needed. They start with a super small stack that can grow (and shrink) via dynamic allocation (and freeing). They are as simple as go f(x), where f() is a function.

Channels

package main
import (
"fmt"
"runtime"
)
func waitForIt() {
ch := make(chan bool)
<-ch
@jeffprestes
jeffprestes / livrovisitas.sol
Created May 16, 2018 18:12
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.4.23+commit.124ca40d.js&optimize=false&gist=
pragma solidity 0.4.23;
contract Owned {
address contractOwner;
constructor() public {
contractOwner = msg.sender;
}
function whoIsTheOwner() public view returns(address) {
@jeffprestes
jeffprestes / livrovisitas.sol
Created May 16, 2018 18:14
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.4.23+commit.124ca40d.js&optimize=false&gist=
pragma solidity 0.4.23;
contract Owned {
address contractOwner;
constructor() public {
contractOwner = msg.sender;
}
function whoIsTheOwner() public view returns(address) {
@jeffprestes
jeffprestes / main
Created May 17, 2018 11:59
ProvaBB - Questao 51
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package br.com.novatrix.teste;
/**
* Programinha de teste para elucidar a questão 51 de um concurso do BB
* Há erro na redação. Em Java vetor é o objeto Vector

Keybase proof

I hereby claim:

  • I am jeffprestes on github.
  • I am jeffprestes (https://keybase.io/jeffprestes) on keybase.
  • I have a public key ASCnTgrRt68TACp8ihu-pcHRN1uYuFN8clLjUAW7GGV-wwo

To claim this, I am signing this object:

Metamask puc
0x98727Fa9cD52D30D35A8dBEe61B598839C3544B5
@jeffprestes
jeffprestes / badger_wrapper.go
Created August 20, 2023 23:34
Wrapper around BadgerDB providing a simple embedded key/value store interface.
// Thanks github.com/alexanderbez for the original wrapper
// This wrapper is an update to alexanderbez's BadgerDB Wrapper to BadgerDB version 4
// https://gist.github.com/alexanderbez/d99fd0383ad57e991e9af9adcbb70b9d
package database
import (
"context"
"fmt"
"log"
"os"