This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Put those functions on your ~/.zshrc or something similar. | |
# Cleans all merged branches (relative to the branch you are). Recommended to run from master. | |
function git_clean_branches() | |
{ | |
# Fetch all merged branches that are not the master branch, and not the current branch | |
echo 'Deleting all merged branches...' | |
for branch in `git branch --merged | awk -F ' * ' '{print $2}' | grep -v -e 'master' | grep -v -e '*'` | |
do | |
echo "Removing .. $branch" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'yaml' | |
Dir.glob("./_posts/*.md").each do |post_file_path| | |
post = YAML.load_file(post_file_path) | |
audio_url = post.fetch("audio") | |
# NOTE: cURL may return multiple lines with length because | |
# it follows the redirects of the server. | |
# | |
lengths = `curl -I -L #{audio_url} | grep "Content-Length"` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Returns a list of files with a given term | |
function git_grep_files() { | |
git grep $1 | awk -F ':' '{print $1}' | sort | uniq | |
} | |
# Replace terms inside a git repository | |
# | |
# Example: | |
# git_replace "original_term" "new_term" | |
function git_replace() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule Math do | |
def sum_list([number]) do | |
number | |
end | |
def sum_list([head|tail]) do | |
head + sum_list(tail) | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#define MAX_N 5000 | |
int main() { | |
int size = 0; | |
int tmp = 0; | |
int i = 0; | |
int soma = 0; | |
scanf("%d",&size); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
bash < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer ) | |
source $HOME/.bashrc | |
rvm install ruby-1.9.2 |
NewerOlder