Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Pedro Costa plcosta

🎯
Focusing
View GitHub Profile
@plcosta
plcosta / Gemfile
Created Jun 24, 2020 — forked from dhh/Gemfile
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
@plcosta
plcosta / postcss.config.js
Created Dec 7, 2018
PostCSS Config - TailwindCSS, Vuetify and PurgeCSS
View postcss.config.js
const tailwindcss = require('tailwindcss')
const autoprefixer = require('autoprefixer')
const purgecss = require('@fullhuman/postcss-purgecss')
module.exports = {
plugins: [
tailwindcss('./tailwind.js'),
autoprefixer({
add: true,
grid: true
@plcosta
plcosta / cpf.fish
Created Jul 24, 2019
Brazilian CPF generator - Fish shell function
View cpf.fish
function cpf
set CPF (curl -X POST -w "\n" -d "acao=gerar_cpf" -d "pontuacao=S" -s https://www.4devs.com.br/ferramentas_online.php)
if type -q pbcopy
echo $CPF | pbcopy;
echo "$CPF copied to clipboard"
else if type -q xclip
echo $CPF | xclip -selection clipboard;
echo "$CPF copied to clipboard"
else
echo $CPF
@plcosta
plcosta / cloudflare-dyndns-ruby.rb
Created Dec 19, 2018
Dynamically update Cloudflare DNS records with the machine's current external IP.
View cloudflare-dyndns-ruby.rb
#!/usr/bin/env ruby
require 'net/http'
require 'json'
class Cloudflare
def initialize(email, key)
@email = email
@key = key
end
@plcosta
plcosta / .gitlab-ci.yml
Created Apr 10, 2019
GitLab CI - Review Apps - Example
View .gitlab-ci.yml
image: ruby:2.5.1
cache:
key: "$CI_COMMIT_REF_NAME"
untracked: true
variables:
POSTGRES_DB: dbname
POSTGRES_USER: dbuser
POSTGRES_PASSWORD: dbpass
@plcosta
plcosta / App.vue
Created Dec 18, 2018
Vue.js - Multiple Layouts
View App.vue
<template>
<router-view></router-view>
</template>
<script>
export default {
name: 'App'
}
</script>
@plcosta
plcosta / axios.js
Last active Dec 14, 2018
Axios Config
View axios.js
'use strict'
import Vue from 'vue'
import axios from 'axios'
// Full config: https://github.com/axios/axios#request-config
// axios.defaults.baseURL = process.env.baseURL || process.env.apiUrl || '';
// axios.defaults.headers.common['Authorization'] = AUTH_TOKEN;
// axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded';
@plcosta
plcosta / script.js
Created Jul 31, 2018
Discourse - Custom Categories Topics List
View script.js
<script type='text/x-handlebars' data-template-name='components/latest-topic-list-item'>
<table>
<tbody>
<tr data-topic-id={{topic.id}} class="{{if topic.archived 'archived'}}">
<td class="main-link">
<tr>
{{raw "topic-status" topic=topic}}
{{topic-link topic}}
{{#if topic.featured_link}}
@plcosta
plcosta / routes.rb
Created May 12, 2018
Nested Routes
View routes.rb
resources :courses, except: :show do
resources :chapters, except: :show do
resources :lessons, except: :show do
resources :attachments, except: :show
end
end
end
@plcosta
plcosta / git.md
Created Feb 9, 2018 — forked from twoism-dev/git.md
Hybrid Git Flow
View git.md

Our Git Flow

We are using a simple git flow based on git flow and github flow. We have two branches develop and master.

develop is a representation of staging

master is a representation of production

The Rules

You can’t perform that action at this time.