Skip to content

Instantly share code, notes, and snippets.

View guilhermewop's full-sized avatar
😎
Coders gonna code

Guilherme Pereira guilhermewop

😎
Coders gonna code
View GitHub Profile
@guilhermewop
guilhermewop / linux-useful-commands.sh
Last active March 25, 2020 21:04
Linux useful commands
#=====================================
# locale
locale-gen pt_BR pt_BR.UTF-8
dpkg-reconfigure locales
#=====================================
# timezone
# change non interactive
@guilhermewop
guilhermewop / mailer.rb
Created March 23, 2020 16:44 — forked from max/mailer.rb
A simple Ruby script to send mass emails
require 'mail'
require 'csv'
FILE = ARGV[0]
Mail.defaults do
delivery_method :smtp, {
address: '',
port: 587,
domain: '',
user_name: '',
@guilhermewop
guilhermewop / set_gnome-terminal_transparency.sh
Created January 12, 2019 17:57 — forked from nirbheek/set_gnome-terminal_transparency.sh
A tiny script to set the transparency for X windows. If AUTOMAGIC_MODE is "true", it tries to find all gnome-terminal windows and applies the transparency to all of them.
#!/bin/bash
# vim: set sts=4 sw=4 et tw=0 :
#
# License: BSD
AUTOMAGIC_MODE="true"
OPACITY_100="0xffffffff"
OPACITY_0="0x0"
: ${XWININFO:=$(type -P xwininfo)}
@guilhermewop
guilhermewop / git-useful-commands.md
Last active October 22, 2018 18:32
Git useful commands

GIT Useful commands

Keeping a clean git fork

git remote add upstream <git-url-project>
git fetch upstream
git merge --ff-only upstream/master
git pull --ff-only upstream master
git push origin master
git fetch --all
# Removing a branch
Local : git branch -D <branch>
Remote : git push origin :<branch>
#---------------------------
# Rename commit message
# ref: http://darrinholst.com/post/359817782
@guilhermewop
guilhermewop / ruby-builtin.bat
Last active January 18, 2018 14:10
ruby-builtin-windows
@echo off
cls
:: Especifica para o rails o ambiente da aplicação
set RAILS_ENV=production
:: Diretório corrente
set current_path=%CD%
:: Diretório da aplicação
set application_path=%CD%\application
:: Diretório dos binários do ruby
@guilhermewop
guilhermewop / php-fpm-7.1_apache_ubuntu.sh
Last active November 6, 2017 03:56
High-performance PHP 7.1 (with php-fpm and mysqlnd) on Apache 2.4 worker (with mod_proxy_fcgi) on Ubuntu
sudo apt-get update -y && apt-get upgrade -y
sudo apt-get install vim \
git \
tree \
libldap2-dev \
libldap-2.4-2 \
libtool-bin \
libzip-dev \
lbzip2 \
@guilhermewop
guilhermewop / filesystem-simulator.py
Created January 23, 2017 19:22
filesystem-simulator.py
#!/usr/bin/python
# -*- coding: utf-8 -*-
class SistemaDeArquivo:
def __init__(self, nome, tamanho = 0):
self.nome = nome
self.tamanho = tamanho
def get_nome(self):
return self.nome
@guilhermewop
guilhermewop / vagrant.md
Created February 7, 2014 14:51
vagrant instructions

Vagrant

Instalação do Vagrant

http://files.vagrantup.com/packages/7ec0ee1d00a916f80b109a298bab08e391945243/vagrant_1.2.7_i686.deb
@guilhermewop
guilhermewop / contador-de-letras.php
Last active February 1, 2016 11:48
Contador de Letras
<?php
/**
* Conta a quantidade de letras de uma determinada palavra
*
* @param $palavra String Palavra a ser analisada pelo contador
* @param $letras Array|String Letras que deseja contar na palavra
* @throws InvalidArgumentException Lança exceção caso não passe pelo menos uma letra para contar na palavra
* @return Int Quantidade de ocorrências de $letras na $palavra
*/
function contarLetras($palavra, $letras = ['a', 'e', 'i', 'o', 'u'])