Skip to content

Instantly share code, notes, and snippets.

View rogerramosme's full-sized avatar
🎯
Focusing

Roger Ramos rogerramosme

🎯
Focusing
View GitHub Profile
@rogerramosme
rogerramosme / launch.json
Created December 4, 2017 11:23
VS Code chrome debug configurations
{
"version": "0.2.0",
"configurations": [
{
"type": "chrome",
"request": "launch",
"name": "Launch Chrome",
"url": "http://localhost:4200",
"webRoot": "${workspaceRoot}",
"sourceMaps": true,
@rogerramosme
rogerramosme / lista-bancos.json
Last active December 4, 2017 11:24
Lista dos bancos com ID's
[
{
"value": "001",
"label": "Banco do Brasil S.A."
},
{
"value": "341",
"label": "Banco Itaú S.A."
},
{
@rogerramosme
rogerramosme / promise.js
Last active December 4, 2017 11:31 — forked from jish/promise.js
An example "always" behavior for ES6 promises. This only works if you do not create / return intermediate promises.
// A thing I want to do
// This flow only involves **one** promise, for example an ajax call
// None of the subsequent `then` or `catch` calls, return new promises.
const explode = false;
const promise = new Promise((resolve, reject) => {
if (explode) {
@rogerramosme
rogerramosme / git-pretty-log
Created December 13, 2017 13:29
Git pretty log
git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
@rogerramosme
rogerramosme / rename-branch-github.txt
Created March 29, 2018 21:58 — forked from niqdev/rename-branch-github.txt
Rename local and remote branch on GitHub
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote
@rogerramosme
rogerramosme / pre-commit-js[x]
Last active March 29, 2018 22:29 — forked from shettayyy/pre-commit-eslint
Pre-commit hook for Linting JS with ESLint before commit.
#!/bin/sh
STAGED_FILES=$(git diff --cached --name-only --diff-filter=ACM | grep ".jsx\{0,1\}$")
ESLINT="$(git rev-parse --show-toplevel)/node_modules/.bin/eslint"
if [[ "$STAGED_FILES" = "" ]]; then
exit 0
fi
PASS=true
@rogerramosme
rogerramosme / markup.html
Last active October 1, 2018 18:31 — forked from ihorduchenko/Amount of flex-items per row
Sass: How adjust amount of flex-items per row
<div class="container">
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
</div>
@rogerramosme
rogerramosme / gist:1446ccf3a84d496f0b44f174ec6cc0c8
Last active October 1, 2018 18:33
Git: Globaly set upstream git branch as current ❤
git config --global push.default current
@rogerramosme
rogerramosme / formatCurrencyBRL.js
Created October 9, 2018 18:55
Format currency BR using toLocalString
const formatCurrencyBRL = (price, showLeadingCurrency = true) => {
price = Math.round(price * 100) / 100;
const options = {
style: showLeadingCurrency ? "currency" : "decimal",
currency: "BRL",
minimumFractionDigits: 2
};
return price.toLocaleString(
@rogerramosme
rogerramosme / ubuntu_agnoster_install.md
Last active November 29, 2018 15:58 — forked from renshuki/ubuntu_agnoster_install.md
Ubuntu 16.04 + Terminator + Oh My ZSH with Agnoster Theme

Install Terminator (shell)

sudo add-apt-repository ppa:gnome-terminator
sudo apt-get update
sudo apt-get install terminator

Terminator should be setup as default now. Restart your terminal (shortcut: "Ctrl+Alt+T").

Install ZSH