Skip to content

Instantly share code, notes, and snippets.

@k-takata
k-takata / 256colors2.bat
Last active November 25, 2023 16:23
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:
@think49
think49 / [html,css,javascript]-idname&classname-specification.md
Last active June 2, 2022 07:22
[HTML, CSS, JavaScript] id名/class名に使用できる文字の種類
@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:
@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
@norio-nomura
norio-nomura / description.md
Last active August 29, 2015 14:16
「【翻訳】関数型プログラミング入門 | POSTD」の「パイプラインを使う」をSwiftで書いてみた。
@haranicle
haranicle / AppStoreScreenShotMaker.sh
Last active June 21, 2020 19:57
A shell script to create AppStore screen shots.
#!/bin/sh
# settings ==========
# src file name
fileNamePrefix="ScreenShotFileNameFor5.5inch"
offsetFor3_5=20
# dest directory name
@hayajo
hayajo / main.go
Last active October 19, 2018 07:00
os.Mkdir(All)で01777なパーミッションのディレクトリを作成
package main
import (
"os"
"syscall"
)
func main() {
oldMask := syscall.Umask(0)
os.Mkdir("hoge_01", 01777) // NG
@hayajo
hayajo / 00.md
Last active August 29, 2015 14:03
NDS_Niigata#1 コマンドラインツール今昔

コマンドラインツール今昔


自己紹介


  • @hayajo
  • プログラマ(社内SE?)
@porjo
porjo / user_data.yaml
Created July 1, 2014 04:52
CoreOS cloud-config
#cloud-config
hostname: coreos-01
coreos:
etcd:
#discovery: https://discovery.etcd.io/xxxxxxxxxxxxxxxx
addr: $private_ipv4:4001
peer-addr: $private_ipv4:7001
units:
@niw
niw / create_yosemite_bootable_disk.sh
Last active April 1, 2019 04:13
How to create a bootable install disk image from Install OS X 10.10 Developer Preview.app
# Since Contents/Resources/createinstallmedia command doesn't work, we need to manually create an disk image.
# Mount InstallESD.dmg
hdiutil mount /Applications/Install\ OS\ X\ 10.10\ Developer\ Preview.app/Contents/SharedSupport/InstallESD.dmg
# Create a temporary writable BaseSystem image.
hdiutil convert /Volumes/OS\ X\ Install\ ESD/BaseSystem.dmg -format UDRW -o rw.dmg
# Get required sectors for packages.
# You'll get these numbers.