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 | |
/** | |
* SKK の人名辞書ファイルから架空の氏名を生成する | |
* | |
* @copyright Copyright (c) 2009 Tomohiro, TAIRA <[email protected]> | |
* @url http://github.com/Tomohiro | |
* | |
* <code> | |
* $name = new FakeFullName(); | |
* echo $name->generate()->kanji(); |
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 | |
$LOAD_PATH << 'lib' | |
$LOAD_PATH << '../lib' | |
require 'optparse' | |
require 'uri' | |
require 'rubygems' | |
require 'daemons' |
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 | |
require 'rubygems' | |
require 'uri' | |
require 'mechanize' | |
agent = WWW::Mechanize.new | |
if ENV['http_proxy'] | |
proxy = URI.parse(ENV['http_proxy']) |
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 System; | |
using System.Collections.Generic; | |
using System.Linq; | |
class Loto6 | |
{ | |
static void Main(string[] args) | |
{ | |
List<int> numbers = Enumerable.Range(1, 43).OrderBy(i => Guid.NewGuid()).Take(6).ToList(); | |
Console.Write(string.Join("-", numbers.ConvertAll<string>(delegate(int i) { return i.ToString(); }).ToArray())); |
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
function url2cmd(url) { | |
var static_flickr_com = url.match(/^http:\/\/farm([0-9]+)\.static\.flickr\.com\/([0-9]+)\/([a-z0-9_]+)\.(jpg|jpeg|png|gif)/); | |
if (static_flickr_com) { | |
var pid1 = RegExp.$1; | |
var pid2 = RegExp.$2; | |
var pid3 = RegExp.$3; | |
var pid4 = RegExp.$4; | |
main(pid1, pid2, pid3, pid4); | |
} else { |
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 | |
# | |
# ex. | |
# ./gmail_check.rb -a your_account -p your_password | |
# | |
require 'optparse' | |
require 'net/https' | |
require 'rubygems' |
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/bash | |
# for Debian Lenny | |
aptitude install ssh -y | |
aptitude install sudo -y | |
aptitude install visudo -y | |
aptitude install ntpdate -y | |
aptitude install openntpd -y | |
aptitude install irc-hybrid -y | |
aptitude install irssi -y |
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 | |
/** | |
* ex. | |
* include 'ruby_like.php'; | |
*/ | |
function puts($args) | |
{ | |
print $args; | |
} |
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 | |
MARKDOWN_SRC='Markdown_1.0.1' | |
UNZIP=`which unzip` | |
WGET=`which wget` | |
PATCH=`which patch` | |
$WGET "http://daringfireball.net/projects/downloads/$MARKDOWN_SRC.zip" | |
$UNZIP "$MARKDOWN_SRC.zip" |
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
(1..50).each do |x| | |
puts case | |
when x % 15 == 0 : 'FizzBuzz' | |
when x % 3 == 0 : 'Fizz' | |
when x % 5 == 0 : 'Buzz' | |
else x | |
end | |
end |
OlderNewer