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 fizz(n) | |
n % 3 == 0 ? 'fizz' : '' | |
end | |
def buzz(n) | |
n % 5 == 0 ? 'buzz' : '' | |
end | |
def fizzbuzz(n) | |
tmp = fizz(n) + buzz(n) |
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
class Option | |
def do | |
p yield | |
end | |
end | |
option = Option.new | |
option.do { :hello } |
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
class None | |
def to_s | |
'None' | |
end | |
end | |
class Some | |
def initialize(v) | |
@v = v | |
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
#!/bin/bash -e | |
# ECS環境でコマンドを実行するためのタスク | |
# | |
# 以下の設定が事前に必要 | |
# * aws-cliのインストール | |
# * ecs-cliのインストール | |
# * jqのインストール | |
# | |
# usage: run_task env command... |
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
#!/bin/sh | |
# スリープ時にVMの時計がずれることがあるため、ホストの時刻を反映するスクリプト | |
# @see https://forums.docker.com/t/docker-for-windows-should-resync-vm-time-when-computer-resumes-from-sleep/17825 | |
docker run --net=host --ipc=host --uts=host --pid=host --security-opt=seccomp=unconfined --privileged --rm alpine date -s "`date -u '+%Y-%m-%d %H:%M:%S'`" |
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
#!/bin/bash | |
aws s3 sync /home/kokuyou/knowledge s3://drossel.knowledge/knowledge | |
mkdir -p /tmp/dump | |
sudo docker exec postgres pg_dumpall -U postgres > /tmp/dump/dump.sql | |
aws s3 sync /tmp/dump s3://drossel.knowledge/dump |
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
user nginx; | |
worker_processes 2; | |
error_log /var/log/nginx/error.log warn; | |
pid /var/run/nginx.pid; | |
events { | |
worker_connections 1024; | |
use epoll; |
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
fastcgi_param QUERY_STRING $query_string; | |
fastcgi_param REQUEST_METHOD $request_method; | |
fastcgi_param CONTENT_TYPE $content_type; | |
fastcgi_param CONTENT_LENGTH $content_length; | |
fastcgi_param SCRIPT_NAME $fastcgi_script_name; | |
fastcgi_param REQUEST_URI $request_uri; | |
fastcgi_param DOCUMENT_URI $document_uri; | |
fastcgi_param DOCUMENT_ROOT $document_root; | |
fastcgi_param SERVER_PROTOCOL $server_protocol; |
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 /etc/nginx/drop; | |
##fastcgi_cache start | |
#set $no_cache 0; | |
# | |
## POST requests and urls with a query string should always go to PHP | |
#if ($request_method = POST) { | |
# set $no_cache 1; | |
#} | |
#if ($query_string != "") { |
NewerOlder