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 'mechanize' | |
require 'readability' | |
require 'progress' | |
require 'nokogiri' | |
list = File.readlines('./urls_to_count.txt').map{|line| line.chomp} | |
agent = Mechanize.new | |
articles = [] | |
list.with_progress("Loading articles") do |url| |
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
# update-alternative (install) | |
sudo update-alternatives --install /usr/bin/ruby ruby2.0 /opt/rubies/2.0.0-p353/bin/ruby 0 | |
sudo update-alternatives --install /usr/bin/erb erb2.0 /opt/rubies/2.0.0-p353/bin/erb 0 | |
sudo update-alternatives --install /usr/bin/gem gem2.0 /opt/rubies/2.0.0-p353/bin/gem 0 | |
sudo update-alternatives --install /usr/bin/irb irb2.0 /opt/rubies/2.0.0-p353/bin/irb 0 | |
sudo update-alternatives --install /usr/bin/rake rake2.0 /opt/rubies/2.0.0-p353/bin/rake 0 | |
sudo update-alternatives --install /usr/bin/rdoc rdoc2.0 /opt/rubies/2.0.0-p353/bin/rdoc 0 | |
sudo update-alternatives --install /usr/bin/ri ri2.0 /opt/rubies/2.0.0-p353/bin/ri 0 | |
sudo update-alternatives --install /usr/bin/testrb testrb2.0 /opt/rubies/2.0.0-p353/bin/testrb 0 |
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 'unicode_utils' | |
UnicodeUtils.titlecase(word).gsub(/(( )(da|de|di|do|du|das|dos|e|a|o))/i) {|s| s.downcase} |
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
# Source: Brightbox (http://wiki.brightbox.co.uk/docs:ruby-ng) | |
sudo apt-get install python-software-properties | |
sudo apt-add-repository ppa:brightbox/ruby-ng | |
sudo apt-get update | |
sudo apt-get install ruby rubygems ruby-switch | |
sudo apt-get install ruby1.9.3 | |
# Switching ruby version: | |
ruby-switch --list | |
sudo ruby-switch --set ruby1.9.1 |
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
<?php | |
/** | |
* Estrutura de dados semelhante ao Array() do php, que permite armazenar mais | |
* de um dado em uma mesma chave | |
* | |
* @author Gabriel Mazetto | |
*/ | |
class GroupArray { |
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
# Path to your oh-my-zsh configuration. | |
ZSH=$HOME/.oh-my-zsh | |
# Set name of the theme to load. | |
# Look in ~/.oh-my-zsh/themes/ | |
# Optionally, if you set this to "random", it'll load a random theme each | |
# time that oh-my-zsh is loaded. | |
ZSH_THEME="robbyrussell" |
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
public function default_table($dadostabela, $css_class, $header) { | |
// TODO: Verificar como vai funcionar permissões para visualização dos relatórios | |
//$bulkoperations = has_capability('moodle/course:bulkmessaging', CONTEXT_SYSTEM); | |
//criacao da tabela | |
$table = new report_unasus_table(); | |
$table->attributes['class'] = "relatorio-unasus $css_class generaltable"; | |
$table->tablealign = 'center'; |
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
[user] | |
name = Gabriel Mazetto | |
email = [email protected] | |
[color] | |
ui = auto | |
diff = auto | |
status = auto | |
[alias] | |
co = checkout | |
cm = commit |
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
<?php | |
/** | |
* Classe de conexão com o Middleware UFSC (Singleton) | |
*/ | |
class Academico { | |
/** | |
* Referência ao acesso a base de dados | |
*/ |
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
# colocar no ~/.profile | |
# Git Branch | |
function parse_git_branch { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1) /' | |
} | |
GREEN="\[\e[0;32m\]" | |
YELLOW="\[\e[0;33m\]" | |
NC="\[\e[0m\]" |