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
| #include <QDebug> | |
| #include <QWidget> | |
| #include <QNetworkReply> | |
| #include <QSslConfiguration> | |
| App::App(QWidget *parent) : | |
| QWidget(parent), | |
| ui(new Ui::App) | |
| { | |
| ui->setupUi(this); |
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 '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] |
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
| # using a twilio phone number for uber sms verification | |
| require 'rubygems' | |
| require 'twilio-ruby' | |
| require 'sinatra' | |
| get '/' do | |
| twiml = Twilio::TwiML::Response.new do |r| | |
| r.Message 'GO' | |
| 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
| require 'nokogiri' | |
| page = Nokogiri::HTML( File.read('teams.html') ) | |
| page.xpath("//table[@id='index']/tbody/tr").each do |tr| | |
| tds = tr.xpath(".//td").map { |e| e.inner_text().strip() } | |
| team_name, hack_name, members, team_id = tds[0], tds[1], tds[2], tr.xpath(".//a[position()=1]").attr('href').value.match(/[0-9]+/)[0].to_i | |
| p [team_id, team_name, hack_name, members] | |
| 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
| package main | |
| import( "fmt" | |
| "math" ) | |
| const x = math.Pi/180 | |
| const R = 6371 | |
| // robpike: https://twitter.com/mattfarina/status/344151151719104512 |
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/sh | |
| # latest trac! | |
| wget "http://download.edgewall.org/trac/Trac-1.0.1.tar.gz" | |
| tar xf Trac-1.0.1.tar.gz | |
| cd Trac-1.0.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
| Dir[ File.join( ARGV[0], '*' ) ].each do |font| | |
| puts "@font-face { font-family: #{font.split('/').last.split('.').first}; src: url('#{font}'); }" | |
| end | |
| # $ ruby font-face-generator.rb fonts/ | |
| # @font-face { font-family: Example; src: url('fonts/Example.otf'); } | |
| # @font-face { font-family: AnotherOne; src: url('fonts/AnotherOne.otf'); } |
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
| # encoding: utf-8 | |
| require 'rest_client' | |
| p RestClient::post( 'http://www.ultimahora.com/_post/sendRecomendar.php', | |
| { 'nombre' => 'UH', | |
| 'email' => '[email protected]', | |
| 'emailAmigos' => '[email protected]', | |
| 'mensaje' => '-', | |
| 'titulo' => 'Link malicioso', |
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 | |
| # encoding: utf-8 | |
| require 'net/http' | |
| def find_email(body) | |
| body.scan(Regexp.new(/\b[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}\b/)).uniq.first | |
| end |