-*- org -*-
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 | |
| # -*- coding: utf-8; -*- | |
| RUBY_DESCRIPTION # => "ruby 1.9.3p385 (2013-02-06 revision 39114) [x86_64-darwin10.8.0]" | |
| # Enumerable#map を自作してみよう | |
| # ただし Enumerable#map と Enumerable#map! は使用禁止 | |
| module Enumerable | |
| def my_map |
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 | |
| cambridge = <<EOF.chomp | |
| こんにちは みなさん おげんき ですか ? わたしは げんき です 。 この ぶんしょう は イギリス の ケンブリッジ だいがく の けんきゅう の けっか にんげん は もじ を にんしき する とき その さいしょ と さいご の もじさえ あっていれば じゅんばん は めちゃくちゃ でも ちゃんと よめる と いう けんきゅう に もとづいて わざと もじの じゅんばん を いれかえて あります 。 どうです ? ちゃんと よめちゃう でしょ ? ちゃんと よめたら はんのう よろしく | |
| EOF | |
| if $0 == __FILE__ | |
| puts cambridge | |
| end |
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
| lsbom /var/db/receipts/com.apple.pkg.DeveloperToolsCLI.bom | awk '{print $1}' | xargs -s 2048 tar cvf /tmp/hoge.tar |
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
| [alias] | |
| l = log --date=short --pretty=format:\"%h\t%an\t%ai %s\" | |
| s = status | |
| d = diff | |
| a = add | |
| b = branch | |
| c = commit | |
| co = checkout |
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
| # Yosemite 用 MacPorts をインストール | |
| MacPorts-2.3.3-10.10-Yosemite.pkg | |
| # Yosemite 用 command line tools をインストール | |
| xcode-select --install | |
| port outdated | |
| # ... | |
| # => zlib 1.2.8_0 < 1.2.8_0 (platform darwin 12 != darwin 14) |
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
| <!DOCTYPE html> | |
| <html lang="ja"> | |
| <head> | |
| <meta charset="utf-8"> | |
| <title>date picker</title> | |
| <link rel="stylesheet" href="pikaday.css"> | |
| <link rel="stylesheet" href="site.css"> | |
| <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css"> | |
| <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-theme.min.css"> |
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
| def fizzbuzz | |
| Enumerator.new do |y| | |
| i = 1 | |
| loop do | |
| y << case | |
| when i % 15 == 0 then "FizzBuzz" | |
| when i % 5 == 0 then "Buzz" | |
| when i % 3 == 0 then "Fizz" | |
| else i | |
| end |
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
| \documentclass[a4paper]{jsarticle} | |
| \usepackage[T1]{fontenc} | |
| \usepackage{lmodern} |
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
| #include <iostream> | |
| #include <vector> | |
| class Super { | |
| public: | |
| Super(int v): value(v) {} | |
| virtual int getValue() const {return value;} | |
| protected: |