Skip to content

Instantly share code, notes, and snippets.

View zamuro's full-sized avatar

Manuel Lucena Pérez zamuro

View GitHub Profile
@zamuro
zamuro / gclbr.sh
Last active May 5, 2021 15:35
git cleanup branch
branch_name=`git branch --show-current`
date_now=`date +%Y%m%d-%H%M`
diff_file=/tmp/$branch_name-$date_now.diff
echo "Saving to $diff_file"
git diff master $branch_name > $diff_file
git checkout master
git push origin $branch_name --delete
git branch -M $branch_name fuckings
git checkout -b $branch_name
git apply $diff_file
### Keybase proof
I hereby claim:
* I am zamuro on github.
* I am zamuro (https://keybase.io/zamuro) on keybase.
* I have a public key ASBR7pHj_R-P_GSxsO2VLxeV23Ris33u-DciF_xsI0Eg_go
To claim this, I am signing this object:
@zamuro
zamuro / main.go
Last active November 27, 2019 10:01
A simple program in Go to determine how many layers of clothing do I need and a convenient ºC to ºF converter
package main
import (
"fmt"
"strconv"
)
func calculate (inpt string) {
a, _ := strconv.ParseFloat(inpt, 64)
if (a < 15 && a >= 10) {
@zamuro
zamuro / chuck.rb
Last active November 10, 2019 08:47
Use chucknorris.io API to get random git commit messages
#!/usr/bin/ruby
## PLACE THIS ON $HOME/bin (or wherever your $PATH executables are) and set appropiate permissions
require 'net/http'
require 'json'
def chuck
url = URI('https://api.chucknorris.io/jokes/random')
request = Net::HTTP.get(url)
response = JSON.parse(request)
response['value']
@zamuro
zamuro / config
Last active January 17, 2020 09:28
Terminator config
[global_config]
suppress_multiple_term_dialog = True
[keybindings]
[profiles]
[[default]]
audible_bell = True
background_darkness = 0.95
background_type = transparent
cursor_color = "#aaaaaa"
font = JetBrains Mono Medium 12
@zamuro
zamuro / .gitconfig
Last active September 27, 2017 10:41
Configuration for automated pull for consul
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
[remote "origin"]
url = git@github.com:[user or organization of your fork]/consul.git
fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
remote = origin
### Keybase proof
I hereby claim:
* I am zamuro on github.
* I am zamuro (https://keybase.io/zamuro) on keybase.
* I have a public key ASDpFj5GKqSQC1H9vPJc_Sx-W4OIb74j2XwwZy1xYS4BKwo
To claim this, I am signing this object: