Skip to content

Instantly share code, notes, and snippets.

View thadeu's full-sized avatar
🏠
Working from home

thadeu thadeu

🏠
Working from home
View GitHub Profile
@thadeu
thadeu / MainApp.js
Created February 17, 2017 13:57 — forked from aphillipo/MainApp.js
Wrapping React Native Navigator
class MainApp extends Component {
constructor(props) {
super(props);
}
renderScene(route, navigator) {
var Component = route.component;
return (
<Component route={route} navigator={navigator} />
);
@thadeu
thadeu / .editorconfig
Last active June 27, 2017 16:36
Default .editorconfig
; Pra todos os arquivos
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
; Estilo de identação em arquivos HTML
[*.html]
indent_style = space
indent_size = 2
@thadeu
thadeu / Dockerfile
Last active December 27, 2017 20:39
Docker for Ruby on Rails
FROM ruby:2.3.1
MAINTAINER Thadeu Esteves Jr <eu@thadeuesteves.com.br>
# libs essentials
RUN apt-get update && apt-get install -y \
build-essential \
libpq-dev \
postgresql-client-9.4 \
libxml2-dev \
@thadeu
thadeu / user_settings.json
Last active April 10, 2018 18:06
VSCode UserSettings
{
"ruby.rubocop.executePath": "/Users/thadeu/.rbenv/shims/",
"csscomb.formatOnSave": true,
"csscomb.preset": "zen",
"csscomb.preset": {
"sort-order": [
["$variable"],
["$include"]
],
"sort-order-fallback": "abc",
@thadeu
thadeu / sync.md
Last active April 13, 2018 12:10
GIT: Sync (rebase) branch master
git fetch origin master
git checkout master
git merge origin/master
git checkout MY_BRANCH
git rebase master
git push -f origin HEAD
@thadeu
thadeu / docker-commands.md
Created May 9, 2018 18:50
Docker commands

Docker Commands

Apagando imagens soltas

docker rmi (docker images -f dangling=true -q)

Apagando containers que já morreram

docker rm -v (docker ps -a -q -f status=exited)

Delete all containers

docker rm (docker ps -a -q)

@thadeu
thadeu / rebasing.md
Created July 19, 2018 15:55
squash and join commits with git rebase

First Check the commits

git log --pretty=oneline --since=1.day

Second

Choose many commits would should be edits

git rebase -i HEAD~N_COMMITS

Third

@thadeu
thadeu / promise_delayed.md
Last active July 20, 2018 07:42
Promise Reject Delayed
export const getNotifications = async (title) => {
  let ASYNC_TIMEOUT = 10000 // 10s
  let didTimeout = false
  let notifications = []

  const workerDelayedPromise = () => {
    return new Promise(async (resolve, reject) => {

      // timeout in order to send reject if delayed
@thadeu
thadeu / html2haml.md
Created October 2, 2018 19:59
Convert to files html.erb to haml
for file in app/views/**/*.html.erb; do html2haml -e $file ${file%erb}haml && rm $file; done
@thadeu
thadeu / config.rb
Created October 26, 2018 17:22 — forked from javierarques/config.rb
Middleman 4 and Webpack 3 integration. Use Middleman with External Pipeline.
# ...
activate :external_pipeline,
name: :webpack,
command: build? ? "npm run build:assets" : "npm run start:assets",
source: ".tmp/webpack_output",
latency: 1
# ...