I hereby claim:
- I am caarlos0 on github.
- I am becker (https://keybase.io/becker) on keybase.
- I have a public key whose fingerprint is C4AE F954 837E 8203 58B9 90C4 E61E 2F7D C14A B940
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
#!/bin/bash -e | |
# common stuff | |
sudo apt-get update | |
sudo apt-get upgrade -y | |
sudo apt-get install -y ubuntu-restricted-extras git zsh terminator curl xsel \ | |
gnome-tweak-tool vim-nox smbclient htop openssh-server s3cmd openvpn network-manager-openvpn | |
# chrome | |
wget -O chrome.deb https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb |
require 'net/http' | |
require 'uri' | |
require 'json' | |
uri = URI('http://divulga.tse.jus.br/2014/divulgacao/oficial/143/dadosdivweb/br/br-0001-e001431-w.js') | |
class String; def percent_of(n) "#{(self.to_f / n.to_f * 100.0).round(2)}%"; end; end | |
begin | |
data = JSON(Net::HTTP.get_response(uri).body) | |
system('clear') | |
puts "\n\n----\n#{data['ht']} - #{data['ea'].percent_of(data['e'])} dos votos apurados\n----" | |
data['cand'].take(3).each do |candidate| |
package sample; | |
import org.junit.*; | |
import org.junit.rules.ExpectedException; | |
import sample.*; | |
import static org.hamcrest.CoreMatchers.*; | |
import static org.hamcrest.MatcherAssert.assertThat; | |
public class MyClassTest { |
I found the Eclipse IDE to be painfully slow. My solution for that is to change some memory configs in eclipse.ini and remove some useless things (useless for me, at least).
cd $ECLIPSE_HOME
find . -iname '*jpa*' -exec rm -rf {} \;
find . -iname '*cvs*' -exec rm -rf {} \;
things I changed in my
eclipse.ini
:
.generate-cols(@n, @i: 1) when (@i =< @n) { | |
@var: ~"col@{i}"; | |
input.col@{i}, | |
.col@{i} { | |
width: @@var; | |
} | |
.table-default td.col@{i} { | |
max-width: @@var; | |
} | |
.generate-cols(@n, (@i + 1)); |
SELECT bl.pid AS blocked_pid, | |
a.usename AS blocked_user, | |
ka.query AS blocking_statement, | |
now() - ka.query_start AS blocking_duration, | |
kl.pid AS blocking_pid, | |
ka.usename AS blocking_user, | |
a.query AS blocked_statement, | |
now() - a.query_start AS blocked_duration | |
FROM pg_catalog.pg_locks bl | |
JOIN pg_catalog.pg_stat_activity a ON a.pid = bl.pid |
WITH table_scans as ( | |
SELECT relid, | |
tables.idx_scan + tables.seq_scan as all_scans, | |
( tables.n_tup_ins + tables.n_tup_upd + tables.n_tup_del ) as writes, | |
pg_relation_size(relid) as table_size | |
FROM pg_stat_user_tables as tables | |
), | |
all_writes as ( | |
SELECT sum(writes) as total_writes | |
FROM table_scans |
#!/bin/sh -e | |
echo "Creating a new jekyll site..." | |
jekyll new bug | |
cd bug | |
echo "Creating needed folders..." | |
mkdir -p _assets/stylesheets | |
mkdir _plugins |
--------------------------------------------------------------------------------------------------------- | |
# app/helpers/application_helper.rb | |
--------------------------------------------------------------------------------------------------------- | |
def horizontal_simple_form_for(record, options={}, &block) | |
options[:html] ||= {} | |
options[:html][:class] = "form-horizontal #{options[:html][:class]}".rstrip | |
options[:wrapper] = :bootstrap_horizontal | |
simple_form_for(record, options, &block) | |
end | |
--------------------------------------------------------------------------------------------------------- |