Looking a post from serokell about elixir's library called ecto.
In the post he presents an migration:
defmodule Blog.Repo.Migrations.Initial do
use Ecto.Migration
def change do
create table ("users") do
regexTel = /^\(11\) 9\d{4}-\d{4}|\((?:1[2-9]|[2-9]\d)\) [5-9]\d{3}-\d{4}$/ | |
"(11) 93827-5555".match(regexTel) // OK | |
"(12) 8201-5555".match(regexTel) // OK | |
"(11) 89201-5555".match(regexTel) // NOT OK | |
"(12) 99201-5555".match(regexTel) // NOT OK | |
"(11) 4201-5555".match(regexTel) // NOT OK |
Looking a post from serokell about elixir's library called ecto.
In the post he presents an migration:
defmodule Blog.Repo.Migrations.Initial do
use Ecto.Migration
def change do
create table ("users") do
#!/bin/bash | |
# Set CNTX=users and NAME=yourusername, to download all your repositories. | |
# Set CNTX=orgs and NAME=yourorgname, to download all repositories of your organization. | |
CNTX={users|orgs} NAME={username|orgname} PAGE=1 \ | |
curl -s "https://api.github.com/$CNTX/$NAME/repos?page=$PAGE&per_page=100" | | |
jq -r '.[]|.ssh_url' | | |
xargs -L1 -n1 -t git clone |
# | |
# bash completion support for PEAR installer. | |
# | |
# Author: Amir Mohammad Saied <amir@php.net> | |
# Based on: http://svn.php.net/viewvc/pear2/sandbox/PEAR_BashCompletion/trunk/pear?view=markup | |
# | |
# Puts this file in /usr/share/bash_completion/ | |
# | |
# Create a symbolic link on /etc/bash_completion.d/ | |
# |
// Scroll function cause zepto doesn't have scrolltop animation | |
;function scrollNew(scrollTo, time) { | |
var scrollFrom = parseInt(document.body.scrollTop), | |
i = 0, | |
runEvery = 5, // run every 5ms | |
time = time || 1000, | |
interval | |
; | |
scrollTo = parseInt(scrollTo); |
#!/bin/bash | |
# pre install | |
sudo apt-get install g++ curl libssl-dev apache2-utils | |
sudo apt-get install git-core | |
sudo apt-get install python-software-properties | |
# install nodejs | |
sudo add-apt-repository ppa:jerome-etienne/neoip | |
sudo apt-get update |
function drawVisualization() { | |
// Create and populate the data table. | |
var data = new google.visualization.DataTable(); | |
data.addColumn('string', 'Ano'); | |
data.addColumn('number', 'Visualizacoes'); | |
// [ column, column, ... ] => row | |
// column pode ser uma String/Int/Float/Date ou o seguinte objeto | |
// { v: "", p : {} } => column, onde v = valor; p: properties | |
// http://code.google.com/apis/visualization/documentation/reference.html#cell_object |
#!/bin/bash | |
docker volume create portainer_data | |
docker run -d -p 9100:9000 --name portainer --restart always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer |
version: "2" | |
services: | |
app: | |
build: | |
context: . | |
dockerfile: Dockerfile.dev | |
volumes: | |
- ./src:/app | |
ports: |
function changed_files { | |
local BASE_BRANCH=$* | |
git diff --name-only ${BASE_BRANCH:="origin/staging"} | grep -v Gemfile | grep -v .codeclimate | grep -v db/schema.rb | tr "\n" " " | |
} | |
function canalyze { | |
codeclimate analyze $(changed_files) $* | |
} |