Skip to content

Instantly share code, notes, and snippets.

@ecomba
ecomba / freedom.sh
Created July 1, 2020 10:12
Little tool that helps you moving away from 'master' as your default branch (and deletes master in the process)
#!/bin/bash
function pause(){
read -p "$*"
}
echo "This script will help you rename your default branch (master) to"
echo "a name of your choosing."
echo ""
echo "Let's rebase your local repository with your origin first"
echo ""
git fetch origin

Keybase proof

I hereby claim:

  • I am ecomba on github.
  • I am ecomba (https://keybase.io/ecomba) on keybase.
  • I have a public key ASBWCpidiG4s9Zzx5IzPwgeG2qAXahMSnoDkFU71_K9JlAo

To claim this, I am signing this object:

@ecomba
ecomba / the_mob.bash
Created June 20, 2016 09:12
Mobbing with bash
function add_mobber() {
touch ~/.the_mob
echo $1:$2:$3 >> ~/.the_mob
}
function the_mob() {
echo $GIT_AUTHOR_NAME
}
function unmob() {
@ecomba
ecomba / gist:ef75d1ff96aeafd7f37d
Created May 31, 2015 08:51
Trying to retrieve the wunderlist lists with HTTParty
# After authenticating with OAuth and getting the auth object
response = HTTParty.get('https://a.wunderlist.com/api/v1/lists',
headers: {
'X-Client-ID' => "#{auth.uid}",
'X-Access-Token' => auth.credentials.token
})
# response will look like so at the moment:
# <HTTParty::Response:0x7faf31dad288 parsed_response={"server_unavailable"=>true},
# @response=#<Net::HTTPServiceUnavailable 503 Service Temporarily Unavailable readbody=true>,
@ecomba
ecomba / todo.html
Created September 24, 2014 15:29
Simple todo app-ish
<html>
<head>
</head>
<body>
<main>
<header>
<h1>I CAN HAZ TODO</h1>
</header>
<section>
<nav>
@ecomba
ecomba / hexagon.rb
Created July 11, 2013 14:10
A little gist showing how you could bind an app with an adapter to a web controller.
class Board
def add_ship ship
ship
end
def shoot(coordinates, player)
raise "Not your turn" if player == 2
'BANG'
end
end
class Board
def initialize ships
@ships = ships
end
def shoot coordinates
if coordinates == 1 # this would call the ships really
@ships = [0,0,-1,1]
return 'HIT'
end
show_project(named: 'Wunderlist', for: 'Chad')
def show_project(named: project_name, for: username,
user: user(for),
project: project(user, named))
Presenter::Board.new(project, user).render
end
def show_project(username, project_name,
user: user(username),
project: project(user, project_name))
Presenter::Board.new(project, user).render
end
def user username
User.with(username)
end