Skip to content

Instantly share code, notes, and snippets.

@base = "gqljb25kaXRpb26iT1KmZ3JvdXBzkoKpY29uZGl0aW9uom9yp2ZpbHRlcnORg6Njb2yqYmlydGhfZGF0ZaNvcGWlbW9udGijdmFsoTKCqWNvbmRpdGlvbqJvcqdmaWx0ZXJzkYOjY29srXNoYXJlX2NhcGl0YWyjb3BlsGdyZWF0ZXJvcmVxdWFsdG-jdmFspjUwMC4wMA"
def example_error
MessagePack.unpack( Base64.decode64( @base ) )
end
def example_success
MessagePack.unpack( Base64.urlsafe_decode64( @base ) )
end
@Brunomm
Brunomm / wait-for-mssql.sh
Created February 5, 2019 19:58
Docker script for await mssql start
#!/bin/sh
# wait-for-mssql.sh
set -e
# host="$1"
shift
cmd="$@"
@Brunomm
Brunomm / Immutable JS Examples
Created November 5, 2018 13:07 — forked from singhshivam/Immutable JS Examples
Immutable JS Examples
List()
var list = Immutable.List([1,2,3])
// [1, 2, 3]
List.isList()
Immutable.List.isList(list)
// true
List.of()
var list = Immutable.List.of(1,2,3);
@Brunomm
Brunomm / example-share-props.js
Created August 10, 2018 19:51
example component with props
const withSelectProps = (SelectComponent) => {
return function ConnectedComponent(props){
return(
<Provider selectProps={props}>
<Consumer>
{ ({selectProps, ...contextProps}) => <SelectComponent {...selectProps} contextProps={contextProps} /> }
</Consumer>
</Provider>
)
}
@Brunomm
Brunomm / React-Docker-Setup.md
Last active July 27, 2018 02:51
React + Docker + Electron

Create folder

    mkdir tmp-folder
    cd tmp-folder

Create file Dockerfile

 FROM node:9.5.0-slim
 LABEL manteiner="[email protected]"
 
 
[
{
"name": "Transjordano",
"type": "dashboard",
"screen": "landscape",
"id": "354d8a45-f317-4c0a-984e-010ef5afd4e3",
"mobile_version": false
},
{
"name": "Checklist Indicadores",
// EXPLICAÇÃO DAS CHAVES
// **name**
// Nome do menu que será esibido ao usuário
// **type**
// Tipo do ítem do menu, pode ser [menu, report, dashboard].
// É necessário saber o tipo, pois a renderização de report e dashboard é diferente.
// É necessário saber se é apenas um menu, pois ai eu seu que a ação é apenas para
// abrir/fechar os submenus
@Brunomm
Brunomm / install-docker.sh
Created January 27, 2018 21:46
Passo a passo para instalar o Docker
# Docker
sudo apt-get remove docker docker-engine docker.io
sudo apt-get update
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
sudo apt-get update && sudo apt-get install docker-ce && sudo usermod -aG docker $(whoami)
sudo addgroup --system docker
@Brunomm
Brunomm / gnome-zsh.script
Last active July 8, 2023 11:08
zsh + oh-my-zsh + gnome-terminal
## INSTALL zsh
sudo apt-get install -y zsh
wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | zsh
chsh -s `which zsh`
## INSTALL oh-my-zsh
sh -c “$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)”
# Talvez seja necessário.
echo 'PROMPT='\''%{$fg[white]%}%n@%m:%~ %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[white]%}$ % %{$reset_color%}'\''' >> ~/.zshrc
@Brunomm
Brunomm / install.sh
Last active November 6, 2023 04:17
Instalação de pacotes essenciais
# Pacotes essenciais
sudo apt-get update && sudo apt-get install -y curl vim apt-transport-https git
sudo apt-get update && sudo apt-get install -y build-essential automake autoconf \
openssl libreadline6 zlib1g libxml2-dev ncurses-dev libgmp-dev libcurl4-openssl-dev \
bison libssl-dev libyaml-dev libreadline6-dev \
zlib1g-dev libncurses5-dev libffi-dev libgdbm-dev \
gawk g++ gcc make libc6-dev patch \
libsqlite3-dev sqlite3 libtool pkg-config libpq-dev
# dnsmasq