Skip to content

Instantly share code, notes, and snippets.


Pedro Costa plcosta

View GitHub Profile
dhh / Gemfile
Created Jun 24, 2020
HEY's Gemfile
View Gemfile
ruby '2.7.1'
gem 'rails', github: 'rails/rails'
gem 'tzinfo-data', '>= 1.2016.7' # Don't rely on OSX/Linux timezone data
# Action Text
gem 'actiontext', github: 'basecamp/actiontext', ref: 'okra'
gem 'okra', github: 'basecamp/okra'
# Drivers
View makefile
include .env
.PHONY: help
help: ## Display this help
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
View init.vim
" Specify a directory for plugins
call plug#begin('~/.vim/plugged')
Plug 'neoclide/coc.nvim', {'branch': 'release'}
Plug 'scrooloose/nerdtree'
"Plug 'tsony-tsonev/nerdtree-git-plugin'
Plug 'Xuyuanp/nerdtree-git-plugin'
Plug 'tiagofumo/vim-nerdtree-syntax-highlight'
Plug 'ryanoasis/vim-devicons'
Plug 'airblade/vim-gitgutter'
dasDaniel / vue-test-utils-helpers.js
Last active Mar 26, 2019
helper functions for vue-test-utils
View vue-test-utils-helpers.js
function withWrapperArray(wrapperArray) {
return {
childSelectorHasText: (selector, str) => wrapperArray.filter(i => i.find(selector).text().match(str)),
hasText: (str) => wrapperArray.filter(i => i.text().match(str)),
areVisible: () => wrapperArray.wrappers.filter(w => w.isVisible()).length,
areHidden: () => wrapperArray.wrappers.filter(w => !w.isVisible()).length,
areAllVisible: () => wrapperArray.wrappers.every(w => w.isVisible()),
areAllHidden: () => wrapperArray.wrappers.every(w => !w.isVisible()),
kuczmama / id_to_uuid.rake
Last active Nov 6, 2019
Migrate a rails project to use uuids
View id_to_uuid.rake
# Inspired by
task id_to_uuid: :environment do
puts "[START] Convert id to uuid"
ActiveRecord::Base.connection.enable_extension 'uuid-ossp' unless ActiveRecord::Base.connection.extensions.include? 'uuid-ossp'
ActiveRecord::Base.connection.enable_extension 'pgcrypto' unless ActiveRecord::Base.connection.extensions.include? 'pgcrypto'
table_names = ActiveRecord::Base.connection.tables - ["schema_migrations", "ar_internal_metadata", "migration_validators"]
table_names.each do |table_name|
puts "[CREATE] uuid column for #{table_name}"
superjose / .gitlab-ci.yml
Last active Nov 18, 2020
This is an example of a .gitlab-ci.yml that is required for Continuous Integration on GitLab projects.
View .gitlab-ci.yml
# Reference:
# GitLab uses docker in the background, so we need to specify the
# image versions. This is useful because we're freely to use
# multiple node versions to work with it. They come from the docker
# repo.
# Uses NodeJS V 9.4.0
image: node:9.4.0
# And to cache them as well.
eolant / Confirm.vue
Last active Nov 28, 2020
Vuetify Confirm Dialog component that can be used locally or globally
View Confirm.vue
<v-dialog v-model="dialog" :max-width="options.width" :style="{ zIndex: options.zIndex }" @keydown.esc="cancel">
<v-toolbar dark :color="options.color" dense flat>
<v-toolbar-title class="white--text">{{ title }}</v-toolbar-title>
<v-card-text v-show="!!message" class="pa-4">{{ message }}</v-card-text>
<v-card-actions class="pt-0">
<v-btn color="primary darken-1" text @click.native="agree">Yes</v-btn>
przbadu /
Last active Nov 11, 2020
Vue js and Rails integration

Setup Rails and Vuejs

  1. Generate new rails app using --webpack flag
rails new myApp --webpack=vue


  1. You can use --webpack=angular for angular application and --webpack=react for react.
vinkla /
Last active Nov 26, 2020
A guide on how to upload images to GitHub's CDN through issues and pull requests.

Upload Images to GitHub's CDN

  1. First, visit any repository on GitHub and click your way through to the issues page.

  2. Create a new issue by clicking the New Issue button. You'll now see title and description fields.

  3. Drag-and-drop an image onto the description field. This will start the uploading process.

  4. Copy the URL and use it in README, issues or pull requests however you like on GitHub.

jpweber /
Last active May 22, 2020
# Load fishmarks (
. $HOME/.fishmarks/
alias rmi "rm -i"
alias ark "docker run --rm -u (id -u) -v ~/.kube/config:/kubeconfig -e KUBECONFIG=/kubeconfig"
alias oc "code ."
# kubernets aliases
alias kget "kubectl get"
You can’t perform that action at this time.