- upgrade nvim (in my case, I have the master version):
$ brew tap neovim/neovim
$ brew reinstall --HEAD neovim
- check Python 2 and 3, if are installed:
$ which python2
#!/bin/bash | |
bash < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer ) | |
source $HOME/.bashrc | |
rvm install ruby-1.9.2 |
#include <stdio.h> | |
#define MAX_N 5000 | |
int main() { | |
int size = 0; | |
int tmp = 0; | |
int i = 0; | |
int soma = 0; | |
scanf("%d",&size); |
defmodule Math do | |
def sum_list([number]) do | |
number | |
end | |
def sum_list([head|tail]) do | |
head + sum_list(tail) | |
end | |
end |
# 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() { |
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"` |
# 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" |
Every finete state machine that does not need to hold state can be represented by a mutual recursive pair (or more) of functions.
You can implement mutual recursion using the built-in and
keyword between functions.
It is also possible to implement it using a higher order function (a function that receives another function).
version: "3.3" | |
services: | |
db: | |
image: postgres | |
ports: | |
- "5432" | |
web: | |
build: | |
context: . | |
dockerfile: Dockerfile |