Skip to content

Instantly share code, notes, and snippets.

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

José Luiz Tafarel jltafarel

🏠
Working from home
View GitHub Profile
@jltafarel
jltafarel / clean-up-boot-partition-ubuntu.md
Created July 30, 2019 12:15 — forked from ipbastola/clean-up-boot-partition-ubuntu.md
Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64

Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64

Reference

Case I: if /boot is not 100% full and apt is working

1. Check the current kernel version

$ uname -r 
@jltafarel
jltafarel / cloudSettings
Created March 29, 2019 16:32 — forked from luizcarraro/cloudSettings public
Visual Studio Code Settings Sync Gist
{"lastUpload":"2018-10-30T13:26:58.960Z","extensionVersion":"v3.2.0"}
@jltafarel
jltafarel / .editorconfig
Last active July 26, 2018 13:51
TalentRH Linter
# editorconfig.org
root = true
[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
#!/bin/bash
echo "Instalando pacotes globais via NPM..."
npm i -g sails ember-cli nodemon bower pm2
echo "Pacotes globais instalados."
@jltafarel
jltafarel / iHate8080Port.sh
Last active May 19, 2017 12:31
Deep knowledge decision based algorithm to determine assertive and poor objective port numbers
#!/bin/bash
#! Usage: ./iHate8080Port.sh range
awk -v loop=1 -v range=$1 'BEGIN{
srand()
do {
numb = 1 + int(rand() * range)
if (!(numb in prev)) {
print numb
prev[numb] = 1
require File.expand_path('orm/file_handler')
require 'securerandom'
class YAMLAdapter
attr_accessor :id, :persisted
$path = 'db'
$file = "contact.txt"
def initialize(args)
args.each do |key, value|
@jltafarel
jltafarel / filterable.rb
Created October 16, 2016 19:18 — forked from justinweiss/filterable.rb
Filterable
# Call scopes directly from your URL params:
#
# @products = Product.filter(params.slice(:status, :location, :starts_with))
module Filterable
extend ActiveSupport::Concern
module ClassMethods
# Call the class methods with the same name as the keys in <tt>filtering_params</tt>
# with their associated values. Most useful for calling named scopes from
@jltafarel
jltafarel / .gitignore
Last active August 18, 2016 20:00
Wordpress Git Configuration
# Keep these files out of the repo
/wp-content/themes/twenty*
/wp-content/upgrade
/wp-content/uploads
/sitemap.*
/wp-config.php
*.sql
# Hidden files
*.DS_Store
@jltafarel
jltafarel / russian_roulet.sh
Created April 27, 2016 13:13
Russian Roulet
[ $[ $RANDOM % 6 ] = 0 ] && echo "Shoot" || echo "Click"
@jltafarel
jltafarel / conditional.js
Created April 15, 2016 13:09
Handlebars helper to use conditional operators.
import Ember from 'ember';
export function conditional(params/*, hash*/) {
if (arguments.length > 3) {
throw new Error("Handlerbars Helper 'conditional' needs 3 parameters");
}
var first = params[0],
operator = params[1],
last = params[2];