$ python -c "import SimpleHTTPServer;SimpleHTTPServer.test()"
Run this in any directory and create a instance web server.
$ python -c "import SimpleHTTPServer;SimpleHTTPServer.test()"
Run this in any directory and create a instance web server.
Posted 2008 September 24 at 10:53 a.m.
javascript:document.body.contentEditable='true'; document.designMode='on'; void 0
If you cut and paste the code into your address bar it will allow you to edit the current page. Nothing is saved on the Host computer but just some good old fashioned fun.
Posted 2008 July 07 at 3:14 p.m.
data = {:foo => {:bar => 'baz'}} p data.to_query #=> "foo%5Bbar%5D=baz"
Posted 2008 March 26 at 3:29 p.m.
<?php $data = array('foo' => array('bar' => 'baz')); $query = http_build_query($data); var_export($query); //=> 'foo%5Bbar%5D=baz' ?>
Posted 2008 March 26 at 3:29 p.m.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html lang="en"> <head> <meta http-equiv="Content-type" content="text/html; charset=utf-8" /> <title>What Day of the Week?</title> <style type="text/css" media="screen"> body {font: 75% "Lucida Grande", "Trebuchet MS", Verdana, sans-serif;text-align: center;color: #204a87;} span {font-size: 10em;} </style> </head> <body> <span><?php echo date("l");?></span> </body> </html>
Posted 2008 March 05 at 10:36 a.m.
import BaseHTTPServer class WebRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler): def do_GET(self): if self.path == '/foo': self.send_response(200) self.do_something() else: self.send_error(404) def do_something(self): print 'hello world' server = BaseHTTPServer.HTTPServer(('',80), WebRequestHandler) server.serve_forever()
Posted 2008 February 13 at 7:01 p.m.
require 'net/sftp' Dir.chdir DIRECTORY do files = Dir.glob '*' puts "files to upload: " p files Net::SFTP.start(sftp.example.org, 22, username, password) do |sftp| files.each do |file| sftp.put_file file, "~/" end end end
Posted 2008 February 12 at 11:19 a.m.
::==chwallpaper.bat @echo off reg /add HKCU\Control Panel\Desktop\WallPaper /v wallpaper /t REG_SZ /d c:\images\wallpaper.bmp
Posted 2008 January 30 at 7:29 p.m.
#!/usr/bin/env python from relationships import * from alcohol import shot, beer def valentines_day(self): if self.dating: if self.money == 0: self.dating = False elif self.num_prev_dates == 0: self.money -= dinner() self.money -= pointless_gift() else: self.money -= dinner()/sqrt(self.num_prev_dates) if randInt(self.num_prev_dates): self.money -= pintless_gift()/self.num_prev_dates elif self.married: if self.years_married < 5: self.money -= dinner()/(self.years_married ** 2) else: pass else: while self.blood_alcohol < .08: self.blood_alcohol += beer() while self.blod_alcohol < .22: self.blood_alcohol += shot() sleep(86400)
Posted 2008 January 27 at 2:03 p.m.
SEMANTIC KNIGHT:
None shall pass without formally defining the ontological
meta-semantic thingies of their domain something-or-others!
HACKER:
What?
SEMANTIC KNIGHT:
None shall pass without using all sorts of semantic
meta-meta-meta-stuff that we will invent Real Soon Now!
HACKER:
I have no quarrel with you, good Sir Knight, but I must get my
work done on the Web. Stand aside!
SEMANTIC KNIGHT:
None shall find anything on the Internet without semantic metadata!
HACKER:
So be it!
HACKER and SEMANTIC KNIGHT:
Aaah!, hiyaah!, etc.
[HACKER chops the SEMANTIC KNIGHT's first argument off by building
efficent statistical/heuristic search engines]
HACKER:
Now stand aside, worthy adversary.
SEMANTIC KNIGHT:
'Tis but a scratch.
HACKER:
A scratch? Your argument has been cut off!
SEMANTIC KNIGHT:
No, it isn't.
HACKER:
Well, what's that, then?
SEMANTIC KNIGHT:
I've had worse. None shall have an effective syndication network
without RDF Site Summaries!
[clang]
Hiyaah!
[clang]
Aaaaaaaah!
[HACKER chops the SEMANTIC KNIGHT's second argument off by
building the blogs/RSS/Aggregators/Bloglines/etc. network ]
HACKER:
Victory is mine!
SEMANTIC KNIGHT:
Have at you!
[kick]
HACKER:
Eh. You are indeed brave, Sir Knight, but the fight is mine.
SEMANTIC KNIGHT:
Oh, had enough, eh?
HACKER:
Look, you stupid &^%$# You've got no arguments left.
SEMANTIC KNIGHT:
Yes, I have.
HACKER:
Look!
SEMANTIC KNIGHT:
Just a flesh wound.
[kick]
HACKER:
Look, stop that.
SEMANTIC KNIGHT:
You won't be able to get machine-machine services without an
ontology to formally describe all the relationships!
[kick]
HACKER:
Right!
[whop]
[HACKER chops the SEMANTIC KNIGHT's third argument off by building
SOAPy and RESTful services with only implicit semantic descriptions]
SEMANTIC KNIGHT:
Right. I'll do you for that!
HACKER:
You'll what?
SEMANTIC KNIGHT:
Come here!
HACKER:
What are you going to do, bleed on me?
SEMANTIC KNIGHT:
I'm invincible!
HACKER:
You're a looney.
SEMANTIC KNIGHT:
The SEMANTIC Knight always triumphs! Have at you! Come on, then. I
have an battalion of KR theorists on my side
[whop]
[HACKER chops the SEMANTIC KNIGHT's last argument off with an
army of actual code writers]
SEMANTIC KNIGHT:
Oh? All right, we'll call it a draw.
HACKER:
Come on, folks, let's go.
SEMANTIC KNIGHT:
Oh. Oh, I see. Running away, eh? You yellow ^&^%$s! Come back here
and take what's coming to you. I'll bite your legs off!
Originally posted on xml-dev.
Posted 2008 January 18 at 11:13 a.m.