Skip to content

Instantly share code, notes, and snippets.

@norio-nomura
norio-nomura / description.md
Last active August 29, 2015 14:16
「【翻訳】関数型プログラミング入門 | POSTD」の「パイプラインを使う」をSwiftで書いてみた。
@norio-nomura
norio-nomura / datesMatchingComponents.swift
Created March 18, 2015 15:04
SequenceOf<T>とGeneratorOf<T>を使う
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
@robbwagoner
robbwagoner / curlit.sh
Last active December 13, 2019 12:09
Measure Latency With Curl
#!/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:
@think49
think49 / [html,css,javascript]-idname&classname-specification.md
Last active June 2, 2022 07:22
[HTML, CSS, JavaScript] id名/class名に使用できる文字の種類
@k-takata
k-takata / 256colors2.bat
Last active August 4, 2024 17:33
Testing ANSI color sequence on Windows 10 and other terminal emulators
@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: