Skip to content

Instantly share code, notes, and snippets.

View lucasrcezimbra's full-sized avatar
🐍

Lucas Rangel Cezimbra lucasrcezimbra

🐍
View GitHub Profile
#!/bin/bash
sudo cp rangel /usr/bin/
sudo chmod 777 /usr/bin/rangel

Configurando o padrão de commit

  • Acesse pelo terminal: aluno6@aluno6-OptiPlex-990:~/Workspace/RegistroLivre/.git/hooks

  • Abra o arquivo commit-msg.sample pelo gedit: gedit commit-msg

  • Substitua o conteúdo pelo texto abaixo:

#!/usr/bin/env ruby
# utf:8
#!/bin/bash
#
# Script para deploy de Rails 3.2.17
# nos servidores compartilhados da Kinghost
# Desenvolvido por Gustavo Kuklinski (@tuxlinski)
# http://www.kuklinski.com.br
#
# Até o momento o Script apenas funciona caso você tenha mais de UMA aplicação
# criada pelo painel de controle!
# Moved to https://github.com/lucasrcezimbra/dotfiles/
@lucasrcezimbra
lucasrcezimbra / gist:4d06be0012f4f105ee98a6da891eaf2c
Last active February 9, 2017 19:59
Vim Regex Find and Replace
Substitui:
<link rel="stylesheet" href="css/font-awesome.min.css">
por
<link rel="stylesheet" href="{% static 'css/font-awesome.min.css %}">
Find:
\(src\|href\)="\(\(img\|css\|js\)[^)]\{-}\)"
Replace:
s/\(src\|href\)="\(\(img\|css\|js\)[^)]\{-}\)"/\1="{% static '\2' %}"/g
@lucasrcezimbra
lucasrcezimbra / happynumbers.py
Created September 22, 2016 23:54
Happy Numbers
def happy(number):
if number < 10:
return number in (1,7)
next_ = sum(int(char) ** 2 for char in str(number))
return happy(next_)
assert all([happy(n) for n in (1, 10, 100, 130, 97)])
assert not all([happy(4) for n in (2,3,4,5,6,8,9)])
@lucasrcezimbra
lucasrcezimbra / fizzbuzz.py
Created September 22, 2016 23:56
FizzBuzz in Python
"""
Regras do FizzBuzz
1. Se a posição for multipla de 3: fizz
2. Se a posição for multipla de 5: buzz
3. Se a posição for multipla de 3 e 5: fizzbuzz
4. Para qualquer outra posição fale o próprio nº.
"""
from functools import partial
@lucasrcezimbra
lucasrcezimbra / Gemfile
Created September 27, 2016 18:47
Josephus in Ruby - tests with RSpec
source 'https://rubygems.org'
ruby '1.9.3'
# RSpec
gem 'rspec-rails'
@lucasrcezimbra
lucasrcezimbra / rename_images_gallery.py
Last active February 22, 2017 15:18
Script to rename images for gallery
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac