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' | |
| require 'net/http' | |
| require 'uri' | |
| require 'cgi' | |
| def data_for(id) | |
| uri, nice_data = URI.parse('http://tsje.gov.py/dinamics/app/consulta-al-padron.php'), {} | |
| http = Net::HTTP.new(uri.host, uri.port); req = Net::HTTP::Post.new(uri.path); req['Host'] = 'tsje.gov.py'; req['Referer'] = 'http://tsje.gov.py/'; req['X-Requested-With'] = 'XMLHttpRequest'; req.set_form_data( { 'cedula' => id }); res = http.request(req); raw_html = res.body; span6_count = 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
| <?php | |
| /* | |
| Template Name: Extended category | |
| (we want to enable many plugins that do not work with the default category template) | |
| */ | |
| ?> | |
| <?php |
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 |
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' => 'web@ultimahora.com', | |
| 'emailAmigos' => 'alguncorreo@gmail.com', | |
| '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
| 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
| #!/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
| 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
| 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
| # 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 |
OlderNewer