- Author
Raymond Hettinger
- Release
- Date
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
from fabric.api import env, run, sudo, local, put | |
def production(): | |
"""Defines production environment""" | |
env.user = "deploy" | |
env.hosts = ['example.com',] | |
env.base_dir = "/var/www" | |
env.app_name = "app" | |
env.domain_name = "app.example.com" | |
env.domain_path = "%(base_dir)s/%(domain_name)s" % { 'base_dir':env.base_dir, 'domain_name':env.domain_name } |
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
海底ケーブルの配置と海外とのping調査 | |
目的 | |
各国のpingの調査と、それがどのくらい体感で差を生むのか | |
またそこから考察できることを適当に書く | |
調査前の体感情報について | |
まず調査前の体感情報についてまとめておくことで、調べた結果が現実と乖離していないことを確認するため | |
・韓国人がホストだと多少のラグを感じる |
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 python | |
# -*- coding: utf-8 -*- | |
""" | |
フレームワークとして Flask(http://flask.pocoo.org/) を、OAuth ライブラリとして oauth2(http://pypi.python.org/pypi/oauth2/) を利用したサンプルプログラムです。 | |
下のコードを保存して (oauth_consumer.py とします)、YOUR_CONSUMER_KEY, YOUR_CONSUMER_SECRET となっている部分を自分の consumer_key, consumer_secret で置き換えます。 | |
$ python oauth_consumer.py | |
... で起動してから http://localhost:5000 に Web ブラウザでアクセスして下さい。 |
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
<IfModule mod_rewrite.c> | |
RewriteEngine on | |
RewriteCond %{HTTP:Accept-Encoding} gzip | |
RewriteCond %{REQUEST_FILENAME} !.gz$ | |
RewriteCond %{REQUEST_FILENAME}.gz -s | |
RewriteRule .+ %{REQUEST_URI}.gz | |
<FilesMatch ".html.gz$"> | |
ForceType text/html | |
AddEncoding x-gzip .gz |
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
import actors.Actor | |
import io.Source | |
import java.lang.StringBuilder | |
import scala.util.continuations.{reset, shift} | |
import scala.actors.Actor.{loop, react} | |
/** | |
* {@link Request}を実行し、{@link Response}を返すtrait | |
*/ | |
trait Http { |
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
package controllers; | |
import play.*; | |
import play.data.Upload; | |
import play.db.Model.BinaryField; | |
import play.libs.MimeTypes; | |
import play.mvc.*; | |
import java.io.ByteArrayInputStream; | |
import java.io.ByteArrayOutputStream; |
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
public class BeansValidator { | |
private ClassValidator classValidator; | |
private List<String> validMessages = new ArrayList<String>(); | |
private BeansValidator() {} | |
public BeansValidator(Class clazz) throws Exception{ | |
classValidator = new ClassValidator(clazz); | |
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
package org.ryu22e; | |
import org.junit.Test; | |
import org.junit.experimental.runners.Enclosed; | |
import org.junit.runner.RunWith; | |
/** | |
* @author ryu22e | |
* @see <a href="http://d.hatena.ne.jp/shuji_w6e/20111205/1323098690">http://d.hatena.ne.jp/shuji_w6e/20111205/1323098690</a> | |
*/ |
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
#!/bin/bash | |
# This way you can customize which branches should be skipped when | |
# prepending commit message. | |
if [ -z "$BRANCHES_TO_SKIP" ]; then | |
BRANCHES_TO_SKIP=(master develop test) | |
fi | |
BRANCH_NAME=$(git symbolic-ref --short HEAD) | |
BRANCH_NAME="${BRANCH_NAME##*/}" |
OlderNewer