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 | |
def tagz0r(char) | |
return char if char == " " | |
tagz0rz = %w{b i u s sub sup}.select{|c| rand(2) == 1} | |
colorz0r = %w{aqua black blue fuchsia magenta orange yellow cyan green lime purple red teal}[rand(13)] | |
sizez0r = (4..7).to_a[rand(4)] | |
fontz0r = ["Arial","Century Gothic","Book Antiqua","Comic Sans MS","Courier New","Fixedsys","Franklin Gothic Medium","Garamond","Impact","Lucida Console","System","Times New Roman","Trebuchet MS","Verdana"][rand(14)] | |
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 | |
class Array | |
def rand | |
self[super(self.length)] | |
end | |
end | |
def tagz0r(char) | |
return char if char == " " |
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 | |
# Usage: ./autotune.rb "sreegs ahuj9" | |
class Array | |
def rand | |
self[super(self.length)] | |
end | |
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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" | |
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en-us"> | |
<head> | |
<meta http-equiv="content-type" content="text/html; charset=utf-8" /> | |
<title>Jarinheit - Jarin Udom's Blog</title> | |
<meta name="author" content="Jarin Udom" /> | |
<link href="http://feeds.feedburner.com/jarinheit" rel="alternate" title="Jarinheit" type="application/atom+xml" /> | |
<!-- syntax highlighting CSS --> |
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
var urlString:String = "http://example.com/myfile.zip"; | |
var urlReq:URLRequest = new URLRequest(urlString); | |
var urlStream:URLStream = new URLStream(); | |
var fileData:ByteArray = new ByteArray(); | |
urlStream.addEventListener(Event.COMPLETE, loaded); | |
urlStream.load(urlReq); | |
function loaded(event:Event):void { | |
urlStream.readBytes(fileData, 0, urlStream.bytesAvailable); | |
writeFile(); |
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
var urlString:String = "http://example.com/myfile.zip"; | |
var urlReq:URLRequest = new URLRequest(urlString); | |
private var urlStream:URLStream = new URLStream(); | |
private var fileStream:FileStream = new FileStream(); | |
urlStream.addEventListener(Event.COMPLETE, loaded); | |
urlStream.addEventListener(ProgressEvent.PROGRESS, writeFile); | |
var file:File = File.desktopDirectory.resolvePath("myfile.zip"); | |
fileStream.openAsync(file, FileMode.WRITE); |
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
# config/environment.rb | |
config.gem 'mislav-will_paginate', :version => '~> 2.3.8', :lib => 'will_paginate', | |
:source => 'http://gems.github.com' |
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
# config/environment.rb | |
config.gem 'will_paginate', :version => '~> 2.3.8', | |
:source => 'http://gemcutter.org' |
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
# Should match (case insensitive): | |
# whatever.jpg | |
# WHATEVER.JPG | |
# folder/whatever.png | |
# Should not match: | |
# folder/__MACOSX/whatever.jpg | |
if !(entry.name =~ /__MACOSX/) && (entry.name.downcase =~ /\.(jpg|jpeg|png|gif)/) | |
#stuff |
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 | |
class Array | |
def rand | |
self[super(self.length)] | |
end | |
end | |
class String | |
def to_tag_s(tags) |