This file contains 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
/** | |
* domready.js | |
* | |
* Cross browser mozilla's 'onDOMContentLoaded' implementation. | |
* Executes a function when the dom tree is loaded without waiting for images. | |
* | |
* Based on +Element.Events.domready+ from Mootools open source project, | |
* this tiny javascript library adds the emulated 'DOMContentLoaded' functionality. | |
* | |
* Features: |
This file contains 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 'enumerator' | |
def random_string(length=10, s="") | |
length.enum_for(:times).inject(s) do |result, index| | |
s << rand(93) + 33 | |
end | |
end |
This file contains 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
/** | |
* Helper object to parse the query string variables from | |
* <script> element's src attribute. | |
* | |
* For example, in test.html: | |
* | |
* <script src="test.js?name=value"></script> | |
* | |
* and in test.js, you can get query as name/value pairs: | |
* |
This file contains 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/ruby | |
require 'webrick' | |
include WEBrick | |
def start_webrick(config = {}) | |
config.update(:Port => 5001) | |
server = HTTPServer.new(config) | |
yield server if block_given? |
This file contains 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
creating the Subversion repository | |
% svnadmin create --fs-type fsfs path-to-svn-repos | |
% mkdir tmp | |
% cd tmp | |
% mkdir webframework | |
% cd webframework | |
% mkdir trunk branches tags | |
% cd .. | |
% svn import . file:///path-to-svn-repos --message 'Initial repository layout' | |
This file contains 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
class Array | |
# Array#product | |
# ------------- | |
# Returns the cartesian product of the receiver and the arrays given as arguments. | |
# | |
# Usage: | |
# [1, 2, 3].product([4, 5]) # => [[1, 4], [1, 5], [2, 4], [2, 5], [3, 4], [3, 5]] | |
# [1, 2].product([1, 2]) # => [[1, 1], [1, 2], [2, 1], [2, 2]] | |
# [1, 2].product([3, 4],[5, 6]) # => [[1, 3, 5], [1, 3, 6], [1, 4, 5], [1, 4, 6], |
This file contains 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
diff -ur ./Python-2.5.1.orig/Lib/locale.py ./Python-2.5.1/Lib/locale.py | |
--- ./Python-2.5.1.orig/Lib/locale.py 2006-05-18 11:06:40.000000000 +0900 | |
+++ ./Python-2.5.1/Lib/locale.py 2007-09-09 12:50:14.000000000 +0900 | |
@@ -485,7 +485,7 @@ | |
""" | |
_setlocale(category, _build_localename(getdefaultlocale())) | |
-if sys.platform in ('win32', 'darwin', 'mac'): | |
+if sys.platform in ('win32', 'mac'): | |
# On Win32, this will return the ANSI code page |
This file contains 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 JavaScript implementation of the Secure Hash Algorithm 1 | |
* | |
* Copyright (c) 2008 Takanori Ishikawa <takanori.ishikawa@gmail.com> | |
* All rights reserved. | |
* | |
* Redistribution and use in source and binary forms, with or without | |
* modification, are permitted provided that the following conditions | |
* are met: | |
* |
This file contains 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
/* | |
* A Simple BDD (Behaviour Driven Development) library for JavaScript. | |
* | |
* Copyright (c) 2008 Takanori Ishikawa <takanori.ishikawa@gmail.com> | |
* All rights reserved. | |
* | |
* Redistribution and use in source and binary forms, with or without | |
* modification, are permitted provided that the following conditions | |
* are met: | |
* |
This file contains 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
import array | |
for byte in array.array('B', "ABCDEFG"): | |
print byte # prints 65, 66, 67, 68, ... and so on. |
OlderNewer