- 質問:AWSにEC2インスタンスを立てたことがある人?
- AWSのアカウント持ってない人はこの機会に取得してみよう
- クレカがない人は言ってください
- AWSにログインしてみよう https://portal.aws.amazon.com/
- 東京リージョンに変更してみよう
- Debian Jessieのインスタンスを起動してみよう
- Rubyビルド済みインスタンスを用意しました
- サイドバーのAMIから、検索欄に ami-53021a3d と書いて「パブリックイメージ」を選択
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
//: # Swift 3: Working with dates | |
import Foundation | |
let date = Date() | |
let myLocale = Locale(identifier: "bg_BG") | |
//: ### Setting an application-wide `TimeZone` | |
//: Notice how we use if-let in case the abbreviation is wrong. It will fallback to the default timezone in that case. | |
if let myTimezone = TimeZone(abbreviation: "EEST") { | |
print("\(myTimezone.identifier)") |
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
# bashを起動するときに読み込まれる設定ファイル | |
PATH=$PATH:$HOME/local/bin |
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
# /etc/nginx/nginx.conf | |
http { | |
# http://www.xmisao.com/2014/05/09/fluentd-elasticsearch-nginx-log.html | |
log_format ltsv 'time:$time_iso8601\t' | |
'remote_addr:$remote_addr\t' | |
'request_method:$request_method\t' | |
'request_length:$request_length\t' | |
'request_uri:$request_uri\t' | |
'https:$https\t' |
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
# /etc/nginx/sites-enabled/php.conf | |
server { | |
listen 80; | |
server_name php.aws; | |
root /var/www/html; | |
location / { | |
fastcgi_pass unix:/var/run/php5-fpm.sock; | |
fastcgi_index index.php; | |
include fastcgi_params; |
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
# sudo vi /etc/systemd/system/rack-test.service | |
[Unit] | |
Description=rack-test | |
After=syslog.target | |
[Service] | |
User=admin | |
Group=admin | |
WorkingDirectory=/home/admin/rack-test | |
Environment=PATH=/usr/local/bin:/usr/bin:/bin:/home/admin/local/bin |
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
# apache2を再起動 | |
sudo systemctl restart apache2 | |
# apache2の設定を再読み込み | |
sudo systemctl reload apache2 | |
# apache2を止める | |
sudo systemctl stop apache2 |
Since Twitter doesn't have an edit button, it's a suitable host for JavaScript modules.
Source tweet: https://twitter.com/rauchg/status/712799807073419264
const leftPad = await requireFromTwitter('712799807073419264');
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
// I wanted an equivalent to Ruby's `tap` (http://ruby-doc.org/core-2.3.0/Object.html#method-i-tap) in Swift which I could mix into any type to tap into method chains. | |
// Define the interface we want to provide as a protocol | |
private protocol Tap { | |
func tap(block: (Self) -> Void) -> Self | |
} | |
// Extend the `Tap` protocol with a default implementation | |
private extension Tap { | |
func tap(block: (Self) -> Void) -> Self { |
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
var debug = process.env.NODE_ENV !== "production"; | |
var webpack = require('webpack'); | |
module.exports = { | |
context: __dirname, | |
devtool: debug ? "inline-sourcemap" : null, | |
entry: "./js/scripts.js", | |
output: { | |
path: __dirname + "/js", | |
filename: "scripts.min.js" |