View gitignore-for-swift
### https://raw.github.com/github/gitignore/2f7c4e80629d1b02c9e1bce9fc54628ed620d2d6/swift.gitignore
# Xcode
#
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
## Build generated
build/
DerivedData/
View Regexp.swift
import Foundation
class Regexp {
let internalRegexp: NSRegularExpression
let pattern: String
init(_ pattern: String) {
self.pattern = pattern
var error: NSError?
self.internalRegexp = NSRegularExpression( pattern: pattern, options: NSRegularExpressionOptions.CaseInsensitive, error: &error)!
View blog_search_bookmarklet.js
javascript:var%20url=location.href;var%20word=url.match(/(#q=|search\?q=|&q=)(.*?)($|&)/)[2];var%20subw=window.open('https://www.google.co.jp/webhp?tbm=blg#tbm=blg&q='+word).document;
View 404.php
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
<title>お探しのページが見つかりませんでした</title>
<?php get_template_part( 'analytics' ); // create analytics.php template file or delete this line. ?>
</head>
<body>
<div>
View create_todo_formated_file.rb
#!/usr/bin/env ruby
require "date"
def this_year
( ARGV[0] || DateTime.now.year ).to_i
end
def leap_year?
Date.new(this_year).leap?
View twitpic_downloader.rb
# Twitpic downloader with Ruby
#
# This tool enables you to save all your twitpic full-size images.
# Confirmed this tool working with Ruby 2.1.2.
#
# Usage
# $ mkdir work_dir
# $ ruby twitpic_downloader.rb user_name work_dir
#
# MIT License