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
| // ==UserScript== | |
| // @name Amazon Shorten URL Clipper | |
| // @namespace https://gist.github.com/mather | |
| // @version 0.4 | |
| // @updateURL https://gist.github.com/mather/5458140/raw/amazon_shorten.user.js | |
| // @description Amazon商品のショートURLを作成して、商品名を含めたツイートボタンを作成します。 | |
| // @match http://www.amazon.co.jp/* | |
| // @match http://www.amazon.com/* | |
| // @copyright 2013+, mather | |
| // ==/UserScript== |
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 scala.concurrent._ | |
| /* futureを使うときにExecutionContextが必要。 */ | |
| implicit val execctx = ExecutionContext.global | |
| /* futureはscala.concurrentパッケージに定義されているシンタックスシュガー */ | |
| val a = future { Thread sleep 100000 ; "hoge" } | |
| /* 次のFutureの処理を合成 */ | |
| val b = a flatMap ( (str:String) => future { "fuga" + str } ) |
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 <stdio.h> | |
| #include <time.h> | |
| void print_time(const time_t t) | |
| { | |
| char buf[128]; | |
| size_t str_size = 0; | |
| str_size = strftime(buf, 127, "%Y/%m/%d %H:%M:%S", localtime(&t)); | |
| buf[str_size] = 0; |
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
| CC = gcc | |
| OPT = -O2 -Wall | |
| BIN = stat_test | |
| default: bin | |
| bin: $(BIN) | |
| stat_test: stat_test.o | |
| $(CC) $(OPT) -o $@ $< |
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 scala.util.parsing.combinator.JavaTokenParsers | |
| object ParserSample extends JavaTokenParsers { | |
| /* | |
| * RegexParserで定義されたメソッド。 | |
| * default(=true) だと行末の改行などが無視される。 | |
| */ | |
| override def skipWhitespace = false | |
| /* |
NewerOlder