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 'net/http' | |
| require 'nokogiri' | |
| $uri = URI('http://bvmf.bmfbovespa.com.br/cias-listadas/empresas-listadas/BuscaEmpresaListada.aspx?idioma=pt-br') | |
| def fetch_html(post_data) | |
| req = Net::HTTP::Post.new($uri) | |
| req.body = post_data | |
| res = Net::HTTP.start($uri.hostname, $uri.port) { |http| http.request(req) } |
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
| #!/bin/bash | |
| [[ -z "$BYOBU_RUN_DIR" ]] && \ | |
| echo "Not a Byobu session!" 1>&2 && exit 1 | |
| [[ ! -e $BYOBU_RUN_DIR/printscreen ]] && \ | |
| echo "No printscreen found! (try pressing Shift+F7)" 1>&2 && exit 1 | |
| geany $BYOBU_RUN_DIR/printscreen |
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
| #! /usr/bin/env ruby | |
| require 'bigdecimal' | |
| require 'csv' | |
| require 'net/http' | |
| require 'nokogiri' | |
| class CompanyStats | |
| attr_reader :name |
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
| CFLAGS += -Wall | |
| mysql2sqlite: mysql2sqlite.c | |
| $(CC) $(CFLAGS) -o $@ $^ |
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
| [Desktop Entry] | |
| Name=Byobu Terminal | |
| Comment=Advanced Command Line and Text Window Manager | |
| Icon=byobu | |
| Exec=env BYOBU_WINDOWS=split2 gnome-terminal --app-id us.kirkland.terminals.byobu --window-with-profile=Byobu -e byobu | |
| Type=Application | |
| Categories=GNOME;GTK;Utility; | |
| X-GNOME-Gettext-Domain=byobu |
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
| #! /usr/bin/env python | |
| # Examples: | |
| # | |
| ## encoding | |
| # | |
| # $ head -c 135 /dev/urandom | b32backup.py | |
| # ZLBD4SI6YCWDF63FYMQ4X7ZOORL5UYBOXZ4Y2WU54OKEQ4N5LBAFA7YHMYTC3W33KHCENWPK 13CB | |
| # TUK5QT55AXF5PZL6Q6A5RJ7CJ24YZML3WMRQWAI6TCO5XGMOHJWAATO7TUCEM7BCL6FGTC6G 03AF | |
| # 6SZVCA4CTBGIHZXC5DEGMCIOLRJPKGVIQCTWAQZAX4VMNLPULEJLWJMV6AAPIOPUYCVKEEIT 228A |
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 'csv' | |
| CSV do |out| | |
| csv = CSV.new(STDIN) | |
| csv.each do |row| | |
| out << row.map do |x| | |
| if m = x.match(/^\d+$/) | |
| (m[0].to_i * 1.6).round.to_s | |
| elsif m = x.match(/^(\d+)( m)(.*)$/) | |
| (m[1].to_i * 1.6).round.to_s + ' km' + m[3] |
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
| module God | |
| module Conditions | |
| class AppFileTouched < TriggerCondition | |
| def initialize | |
| super | |
| @mutex = Mutex.new | |
| @queue = [] | |
| @condition = ConditionVariable.new | |
| @thread = nil | |
| end |
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
| # Copy and paste the following lines into a shell replacing $1 with the actual username. | |
| # It will then ask for the public key to initialize the .ssh dir. | |
| # The key will be appended to the authorized_keys file; current content (if any) will be preserved. | |
| U=$1 ; H=$(eval echo ~$U) ; sudo mkdir -p $H/.ssh \ | |
| && echo "Paste ssh key: (end with ^D)" \ | |
| && cat > /tmp/$U_key.pub \ | |
| && cat /tmp/$U_key.pub | sudo tee -a $H/.ssh/authorized_keys > /dev/null \ | |
| && rm /tmp/$U_key.pub \ | |
| && sudo chown $U:$U $H/.ssh \ |
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
| gem 'redis' | |
| gem 'json' |