Skip to content

Instantly share code, notes, and snippets.

@hugodias
hugodias / extras.php
Created July 14, 2018 14:38
Wordpress Reading time function with I18n Support
<?php
if ( ! function_exists( 'reading_time' ) ):
/**
* Display post reading time in minutes
*
* @param $post_content
*
* @return string
*/
@hugodias
hugodias / custom_logger.rb
Created July 11, 2018 17:13
Rails custom logger
# lib/custom_logger.rb
class CustomLogger
class << self
attr_accessor :logger
delegate :info, :warn, :debug, :error, :to => :logger
end
end
{
"name": "awesome-btn",
"version": "1.0.0",
"description": "",
"main": "build/index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "webpack --watch",
"build": "webpack"
},
{
"presets": ["env"],
"plugins": [
"transform-object-rest-spread",
"transform-react-jsx"
]
}
var path = require('path');
module.exports = {
entry: './src/index.js',
output: {
path: path.resolve(__dirname, 'build'),
filename: 'index.js',
libraryTarget: 'commonjs2'
},
module: {
rules: [
{
"name": "awesome-btn",
"version": "1.0.0",
"description": "",
"main": "src/index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
{
"name": "awesome-btn",
"version": "1.0.0",
"description": "Awesome button component",
"main": "src/index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "Hugo Dias",
"license": "MIT",
@hugodias
hugodias / pr_etiquette.md
Created May 31, 2018 15:11 — forked from mikepea/pr_etiquette.md
Pull Request Etiquette

Pull Request Etiquette

Why do we use a Pull Request workflow?

PRs are a great way of sharing information, and can help us be aware of the changes that are occuring in our codebase. They are also an excellent way of getting peer review on the work that we do, without the cost of working in direct pairs.

Ultimately though, the primary reason we use PRs is to encourage quality in the commits that are made to our code repositories

Done well, the commits (and their attached messages) contained within tell a story to people examining the code at a later date. If we are not careful to ensure the quality of these commits, we silently lose this ability.

@hugodias
hugodias / .tmux.conf
Last active January 17, 2018 01:45
My tmux config file
set-option -g xterm-keys on
set -g default-terminal "xterm"
# Set bar to the top
set-option -g status-position top
# Keep window name
set-option -g allow-rename off
# ----------------------
@hugodias
hugodias / init.vim
Created January 17, 2018 01:40
My Neovim config file
filetype off
call plug#begin()
" Languages and frameworks
Plug 'vim-ruby/vim-ruby'
Plug 'tpope/vim-rails'
Plug 'pangloss/vim-javascript'
Plug 'mileszs/ack.vim'
Plug 'junegunn/vim-easy-align'