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
## convert somedomain.com to newhost.com | |
require 'rubygems' | |
require 'nokogiri' | |
require 'uri' | |
# change this to File.open | |
html_text = "<a href='http://somedomain.com/something/'> | |
<a href='http://somedomain.com/something/else'>" | |
html = Nokogiri::HTML(html_text) |
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
donp@tower ~/src/parrot/parrot-3.1.0 $ perl Configure.pl | |
auto::byteorder - Compute native byteorder for wordsize.....little-endian. | |
auto::va_ptr - Test the type of va_ptr... | |
step auto::va_ptr died during execution: Unknown va_ptr type at config/auto/va_ptr.pm line 41. | |
at Configure.pl line 77 | |
auto::format - What formats should be used for sprintf............done. |
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
the 99 | |
a 91 | |
to 82 | |
i 75 | |
is 55 | |
in 46 | |
it 41 | |
that 37 | |
of 35 | |
at 34 |
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
donp@sparky:~$ ruby -e 'puts "Hello World."' | |
Hello World. | |
donp@sparky:~$ jruby -e 'puts "Hello World."' | |
donp@sparky:~$ |
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
mysql> create table `test1` ( `id` int(32) ); | |
Query OK, 0 rows affected (0.01 sec) | |
mysql> create table `test2` ( `id` int(32) ) ENGINE=InnoDB; | |
ERROR 1005 (HY000): Can't create table './socialigniter/test2.frm' (errno: 135) | |
mysql> show engines; | |
+------------+---------+----------------------------------------------------------------+ | |
| Engine | Support | Comment | | |
+------------+---------+----------------------------------------------------------------+ |
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
## Ruby [1,2,3].each{|i| puts "I am #{i}"} | |
donp@sparky:~$ mirahc -j -e '[1,2,3].each{|i| puts "I am #{i}"}' | |
Parsing... | |
<inline script> | |
Inferring types... | |
Compiling... | |
DashE | |
Done! | |
## Java |
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
$ cat parallel.rb | |
# parallel | |
work=["A","B"] | |
# Launch threads | |
work.map! do |job| | |
Thread.new do | |
puts "I got #{job}" | |
20000000.times { 4.0/2.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
## node.js | |
var http = require('http'); | |
http.createServer(function (req, res) { | |
res.writeHead(200, {'Content-Type': 'text/plain'}); | |
res.end('Hello World\n'); | |
}).listen(8124, "127.0.0.1"); | |
## node.rb(Goliath) | |
require 'goliath' |
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
== AddRedirectionsModel: migrating =========================================== | |
-- create_table(:redirections) | |
NOTICE: CREATE TABLE will create implicit sequence "redirections_id_seq" for serial column "redirections.id" | |
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "redirections_pkey" for table "redirections" | |
-> 0.2534s | |
Creating shortened URL for existing contents, this may take a moment | |
rake aborted! | |
An error has occurred, this and all later migrations canceled: | |
The single-table inheritance mechanism failed to locate the subclass: 'Page'. This error is raised because the column 'type' is reserved for storing the class in case of inheritance. Please rename this column if you didn't intend it to be used for storing the inheritance class or overwrite Content.inheritance_column to use another column for that information. |
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
$ ./request-log-analyzer ~/Desktop/production.log | |
Request-log-analyzer, by Willem van Bergen and Bart ten Brinke - version 1.11.0 | |
Website: http://railsdoctors.com | |
production.log: 100% [================================] Time: 00:01:01 | |
Request summary | |
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ | |
Parsed lines: 443495 | |
Skipped lines: 88 |