Skip to content

Instantly share code, notes, and snippets.

View matiasinsaurralde's full-sized avatar

Matias Insaurralde matiasinsaurralde

  • Paraguay
View GitHub Profile
require 'open-uri'
require 'nokogiri'
def get_followers_from_page(url)
page, followers = Nokogiri::HTML(open(url).read()), []
user_items = page.xpath("//table[@class='user-item']")
user_items.each do |user_item|
nickname = user_item.xpath(".//a[@data-scribe-action='profile_click']/@href").first.to_s
nickname = nickname[1,nickname.size]
@matiasinsaurralde
matiasinsaurralde / main.cpp
Last active August 29, 2015 14:22 — forked from gokmen/main.cpp
#include <QDebug>
#include <QWidget>
#include <QNetworkReply>
#include <QSslConfiguration>
App::App(QWidget *parent) :
QWidget(parent),
ui(new Ui::App)
{
ui->setupUi(this);

Keybase proof

I hereby claim:

  • I am matiasinsaurralde on github.
  • I am minsaurralde (https://keybase.io/minsaurralde) on keybase.
  • I have a public key whose fingerprint is ABFF 0C89 66E6 2247 76DD 1061 4C06 19C8 F1BC 7BBB

To claim this, I am signing this object:

from pyquery import PyQuery as pq
url = 'https://4.ipinfo.io/AS27866'
d = pq( url=url )
for td in d( 'td' ):
td = d( td )
var elementos = [ 'soy un td', 'soy otro td', 'etc' ];
var elementosAsociativo = { 'soy un td': 'contenido del td',
'asdasdasd': 'asdasdad',
'asdddqqq': 'asdasd' };
for( i in elementos ) {
var elemento = elementos[ i ];
console.log( elemento );
};
@matiasinsaurralde
matiasinsaurralde / gist:9914919746ad818ad53a
Last active December 15, 2015 06:04
ethereum-mining-internals
web3.eth.getWork()
["0x5e1994ba8aa49c2789ef0823fd0402ce396055661b9fe4e3b686a64c1f996482", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x00002334df66437efb5203e24f3d4a263c3dd649b179e4f423d95a69f5425090"]
// web3.eth.getWork() retorna tres valores: Header-Hash, SeedHash y Target
https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_getwork
ℹ 02:06:53.217| Solution found; Submitting to http://127.0.0.1:8545 ...
ℹ 02:06:53.217| Nonce: 59585cd341e28d69
ℹ 02:06:53.217| Mixhash: e192c6ba566a1e43c39fc847b7879098bbb6cf4bc32f96fb2378dde886bd1d00
% ls -lah /Users/matias/Library/Application\ Support/HackHands/main.log 
-rw-r--r--  1 matias  staff   4.5G Mar 14 01:17 /Users/matias/Library/Application Support/HackHands/main.log
% wc -l /Users/matias/Library/Application\ Support/HackHands/main.log 
 67654415 /Users/matias/Library/Application Support/HackHands/main.log
% tail -n 10 /Users/matias/Library/Application\ Support/HackHands/main.log 
2016-03-14T04:17:15.136Z - info: [Lifecycle] Restarting the application
2016-03-14T04:17:15.137Z - info: [Lifecycle] Restarting the application
2016-03-14T04:17:15.137Z - info: [Lifecycle] Restarting the application
2016-03-14T04:17:15.137Z - info: [Lifecycle] Restarting the application
@matiasinsaurralde
matiasinsaurralde / nsurlsessiond_workaround.sh
Created April 14, 2016 04:03
nsurlsessiond workaround (it's taking all the bandwidth)
#!/bin/sh
while :
do
sudo kill -9 `pidof nsurlsessiond`
sleep 1
done
location /test {
default_type 'text/plain';
content_by_lua '
local webengine = require("webengine")
local url = ngx.var.arg_url
ngx.say( webengine.render( url ) )
return
';
}
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCsR3in+84KcH/GHAksqczRE5S+wDgB8qB+SJxvzWw3qjwPSohvuR4WXdQ8UCqjWq/6uGYq79EHlzlKE9P6lJbhEgf9FRwv8k8MSqDjhoQ5QZeXaEE750+PZLK/pb2MkriNXIGxg6ul8V+F0o4XnkVLbefMhQDzLDVgyg0dFwp6TGVqpufmD6gvvwnQD5BHSFMQT3MSq6o/wQj3hc/yhHlhwJ4+6iC7bdBv426fGdCs+nbi2BjXHzLEf7bLks5vOTJexGTHdfPlb5JOBTTfzZ0Kw0BMBjTnJpnRcyGOvQJ/K/a7ye/xusG/ZyDh/NsghPX2BjFPfbN3rW5hzvr3PZhn