【翻訳】関数型プログラミング入門 | POSTD の「パイプラインを使う」をSwiftで書いてみた。
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
import Foundation | |
func dates(#matchingComponents: NSDateComponents, var startDate: NSDate = NSDate(), endDate: NSDate = NSDate.distantFuture() as! NSDate) -> SequenceOf<NSDate> { | |
return SequenceOf<NSDate> { _ -> GeneratorOf<NSDate> in | |
let calendar = NSCalendar(calendarIdentifier: NSCalendarIdentifierGregorian)! | |
calendar.timeZone = NSTimeZone(forSecondsFromGMT: 0) | |
return GeneratorOf<NSDate> { | |
if let nextDate = calendar.nextDateAfterDate(startDate, matchingComponents: matchingComponents, options: .MatchStrictly) | |
where nextDate.compare(endDate) != .OrderedDescending { | |
startDate = nextDate |
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 bash | |
# | |
# curl wrapper returning timing information. | |
# | |
# ORIGIN: https://github.com/mat/dotfiles/blob/master/bin/curlt | |
# | |
# curl format adapted from | |
# http://josephscott.org/archives/2011/10/timing-details-with-curl/ | |
# | |
# Example usage: |
HTML 4.01 は下記リンクでid属性/class属性を定義しています。
id属性値は文法上、NAMEトークンであり、class属性値はCDATAのリストで表されるようです。
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
@echo off | |
rem Based on Todd Larason's 256color2.pl. | |
rem Ported to Windows 10's Command Prompt. | |
setlocal EnableDelayedExpansion | |
rem display the colors | |
rem first the system ones: | |
echo System colors: |
OlderNewer