Skip to content

Instantly share code, notes, and snippets.

View jweslley's full-sized avatar

Jonhnny Weslley jweslley

View GitHub Profile

O Plano de Numeração é o modo de organização dos números dos serviços de telecomunicações de uso público.

A tabela abaixo tem a relação entre as faixas numéricas de telefone fixo e celular:

STFC   Telefonia Fixa Rural  57
       Telefonia Fixa        2 a 5
SMP    Telefonia Celular     9 para as Bandas A (96 a 99) e B (91 a 94)
                             8 para as Bandas D e E
                             7 Celular e Trunking (Nextel)

6 para as bandas A, B, D e E*

@jweslley
jweslley / keybase.md
Created September 17, 2014 14:44
keybase.md

Keybase proof

I hereby claim:

  • I am jweslley on github.
  • I am jweslley (https://keybase.io/jweslley) on keybase.
  • I have a public key whose fingerprint is E569 E19A 0DD4 2D47 7A64 5799 00EA A9A5 CFA5 D628

To claim this, I am signing this object:

@jweslley
jweslley / gitlab.sh
Last active December 16, 2015 12:49
Backup script to Gitlab
#!/bin/sh
# Usage:
# - Save this file in /etc/cron.daily/gitlab
# - Enable execution permission: chmod +x /etc/cron.daily/gitlab
set -e
DB_USERNAME=username
DB_PASSWORD=secret
BACKUP_DIR='/path/to/backup/'
@jweslley
jweslley / export_csv.sql
Created August 9, 2012 19:43
Dump MySQL table into CSV file
SELECT * INTO OUTFILE 'result.csv'
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
LINES TERMINATED BY '\n'
FROM my_table;
@jweslley
jweslley / rails.logrotate
Created January 30, 2012 14:01
Logrotate for Rails
#
# File: /etc/logrotate.d/rails
# Test: logrotate -f /etc/logrotate.d/rails
#
/var/www/*/log/*.log {
daily
dateext
notifempty
missingok
rotate 30
@jweslley
jweslley / asciiplot.sh
Created December 28, 2011 18:52
ASCII plot
usage(){
echo "Usage: $(basename $0) [-c <cols>] [-r <rows>] [-p <pch>]"
exit 2
}
cols=50
rows=20
pch="*"
while getopts "c:r:p:h" option; do
case "$option" in
@jweslley
jweslley / big_o.r
Created April 12, 2011 16:58
Running time of common time complexities
big_O.plot <- function(count,log="") {
n <- seq(count)
plot(n, n*n, log=log, type='l', col='red',
ylab="Running time", xlab='n (# of elements)')
lines(n, n*log(n), col='green')
lines(n, n, col='blue')
lines(n, log(n), col='black')
title('Running time of common time complexities')
@jweslley
jweslley / seeds.rb
Created July 21, 2010 14:08
Rails: loading seeds from csv
require 'csv'
CSV.foreach('path/to/seed.csv', headers: true, col_sep: ';') do |row|
Model.create row.to_hash
end
@jweslley
jweslley / recover grub
Created July 6, 2010 15:11
recover grub
sudo grub
root (hd0,1)
setup (hd0)
quit
package net.abhinavsarkar.util;
import java.util.Iterator;
import java.util.concurrent.BrokenBarrierException;
import java.util.concurrent.CyclicBarrier;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.SynchronousQueue;
import java.util.concurrent.ThreadFactory;
import java.util.concurrent.TimeUnit;