Skip to content

Instantly share code, notes, and snippets.

View brunurd's full-sized avatar

Bruno Araujo brunurd

View GitHub Profile
@brunurd
brunurd / .bashrc
Last active December 6, 2019 09:40
bash PS1 with branch name
# ------------------------------------------------------------------------------- #
# ----------------------------- BRANCH NAME IN BASH ----------------------------- #
# ------------------------------------------------------------------------------- #
# Add those snippet to the bash config file.
# Get git branch function.
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
@brunurd
brunurd / server.bat
Created September 27, 2018 16:26
Start a static server on windows with Python and a 9 lines script.
@echo off
net stop was /y
echo Opening browser...
start "" http://localhost/
echo Starting Python 3.7.0 simple http server...
python -m http.server 80
@brunurd
brunurd / unity-webgl-full-window-css.html
Last active April 3, 2019 12:54
Unity WebGL full window
<!--
Before add this to the your "index.html" file:
- Remove any style="..." attribute.
- Remove any <style> tag.
- Remove any <link rel="stylesheet"...> tag.
-->
@brunurd
brunurd / Cycle.cs
Last active April 3, 2019 12:53
Cycles: A way to use FSM
using System;
using System.Collections.Generic;
namespace Cycles
{
/// <summary>
/// A abstract class to implement a cycle.
/// A cycle is a finite state machine with a data input and output of the same type to every state event.
/// </summary>
/// <typeparam name="TState">The type of the state. Example: Enum, string or int.</typeparam>
@brunurd
brunurd / start.sh
Created July 26, 2019 01:42
msys2 start script (run manually)
#!/bin/sh
# Confirm to every questions.
# Update pacman.
pacman -Syu
# Close the console when it ask to.
# After reinitialize the console:
from __future__ import print_function
import random
import string
import sys
def gen_secret(secret_size):
secret = ""
invalid_chars = [' ','\n','\t','\r','\x0b','\x0c','"','\'','`','\\']
for i in range(0, secret_size):
@brunurd
brunurd / httpd-vhosts.conf
Created October 26, 2019 03:15
apache vhost example
<VirtualHost *:80>
DocumentRoot "files\path\here"
ServerName url.here.com
ServerAlias www.url.here.com
<Directory "files\path\here">
Require all granted
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
@brunurd
brunurd / set-dock-to-bottom.sh
Created October 29, 2019 22:34
Set dock to bottom in Ubuntu 18.04
#!/bin/sh
gsettings set org.gnome.shell.extensions.dash-to-dock dock-position BOTTOM
@brunurd
brunurd / fire.sh
Last active January 14, 2020 13:10
Fire - AWS SAM shell script template
#!/bin/sh
# VARIABLES
CMD=$1
PROJECT="<PROJECT-NAME-HERE>"
S3_DEPLOY_BUCKET="<S3-BUCKET-NAME-HERE>"
PACKAGE_FILE_NAME="packaged.yaml"
EVENTS_FOLDER="events/"
ENVIRONMENT_FILE="env.json"
ANY_CLOUD_FORMATION_PARAMETER="<ANY-CLOUD-FORMATION-PARAMETER-VALUE>"
@brunurd
brunurd / desenvolvimento-web.md
Last active June 1, 2020 22:20
Considerações para uma nova abordagem em desenvolvimento web.

1. Dependências mínimas

Package Tipo
Typescript Linguagem
React + React DOM Componentes
React Router Roteamento
Storybook Design System
Material-UI Design System
Testing Library + Jest Testes