This file contains 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 | |
require 'json' | |
require 'base64' | |
require 'openssl' | |
### CloudFront Key Pair | |
KEY_PAIR_ID = "XXXXX" | |
PRIVATE_KEY = "pk-XXXXX.pem" | |
### Destination URL and RESOURCE for Policy |
This file contains 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 | |
require 'json' | |
### CloudFront Key Pair | |
KEY_PAIR_ID = "XXXXX" | |
PRIVATE_KEY = "pk-XXXXX.pem" | |
### Destination URL and RESOURCE for Policy | |
DST_URL = "https://xxxx.cloudfront.net/index.html" | |
RESOURCE = "http*://xxxx.cloudfront.net/index.html" |
This file contains 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
"============================================================================= | |
" vimrc: vimrcはシステム管理者が必要最小限の設定をしておくものであり、 | |
" 個人用の設定は_vimrc(.vimrc)で行う。 | |
" 従ってvimrcは基本的に変更しない。 | |
" 本設定ファイルでは主に文字コードの自動認識のみ行っている。 | |
"============================================================================= | |
set nocompatible | |
"---------------------------------------- | |
"文字コードの自動認識 | |
"---------------------------------------- |
This file contains 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 <string> | |
#define FOR(i,m,n) for (int i=(m); i<(int)(n) ;i++) | |
int main() { | |
string x = "google"; | |
string y = "gooogle"; | |
int size_x = x.length(); |
This file contains 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
class ColorfulRoad { | |
private: | |
int colorid(char ch) { | |
switch(ch) { | |
case 'R': return 0; | |
case 'G': return 1; | |
case 'B': return 2; | |
default: return -1; | |
} | |
} |
This file contains 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
select FROM_UNIXTIME(TRUNCATE(UNIX_TIMESTAMP(addtime(created_at,'09:00:00'))/300,0)*300) as _time, count(*) | |
from sales | |
where | |
created_at between '2014-01-17 15:00:00' and '2014-01-18 14:59:59' | |
GROUP BY _time; |
This file contains 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
class StackWithTwoQueues | |
def initialize | |
@q1 = [] | |
@q2 = [] | |
end | |
def push(item) | |
@q1 << item | |
end |
This file contains 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
class StackWithSingleQueue | |
def initialize | |
@queue = [] | |
end | |
def push(item) | |
@queue << item | |
end |
This file contains 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
class QueueWithTwoStacks | |
def initialize | |
@s1 = [] | |
@s2 = [] | |
end | |
def enqueue(item) | |
@s1 << item | |
end |
This file contains 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
class QueueWithSingleStack | |
def initialize | |
@stack = [] | |
end | |
def enqueue(item) | |
@stack << item | |
end |
NewerOlder