ChangeLog を書く際によく使われる英語をまとめました。
ほとんど引用です。
// Amazonの注文履歴をTSV形式で出力するスクリプト | |
// | |
// 2015-01-01 時点での DOM 構造に対応, GoogleCrome, Opera でテスト済。 | |
// formatEntry関数を書き換えれば自由な書式で出力できます。 | |
// | |
// 参考: | |
// - Amazonの注文履歴をCSV形式にして出力するスクリプト | |
// https://gist.github.com/arcatdmz/8500521 | |
// - Amazon で使った金額の合計を出す奴 (2014 年バージョン) | |
// https://gist.github.com/polamjag/866a8af775c44b3c1a6d |
limit = 200 | |
post_table = Post.arel_table | |
visibility_ids = PostVisibility.select(:post_id).where(user_id: 1).order(id: :desc).limit(limit).arel.as('t') | |
inner_query = Arel::Table.new(:tmp).project(:post_id).from(visibility_ids.to_sql) | |
Post.where(post_table[:is_public].eq(true).or(post_table[:id].in(inner_query))).limit(limit) |
FROM centos | |
MAINTAINER Ninetails - Carlos Kazuo | |
RUN rpm -Uvh http://mirror.webtatic.com/yum/el6/latest.rpm | |
RUN curl -s http://repos.fedorapeople.org/repos/jkaluza/httpd24/epel-httpd24.repo > /etc/yum.repos.d/epel-httpd24.repo | |
RUN yum install -y xterm git mysql mysql-server httpd24-httpd php55w php55w-common php55w-cli mysql mysql-server php55w-devel php55w-mcrypt php55w-mbstring php55w-mysqlnd php55w-pdo php55w-pecl-xdebug php55w-xml php55w-xmlrpc php55w-opcache | |
RUN /sbin/chkconfig --add httpd | |
RUN /sbin/chkconfig httpd on --level 235 |
var url = 'http://www.example.com/'; | |
var to = '[email protected]'; | |
var sub = 'サーバ障害報告'; | |
var body = "監視中の サーバが停止した模様です。サーバの状態を確認してください。\n" + url ; | |
function myFunction() | |
{ | |
if(check_server(url) != 200){ | |
MailApp.sendEmail(to, sub, body); |
#!perl | |
use strict; | |
use warnings; | |
use Parallel::ForkManager; | |
use POSIX; | |
use String::Random; | |
my $c_start = 1; | |
my $c_end = 64; |
test: | |
adapter: sqlite3 | |
encoding: utf8 | |
pool: 5 | |
timeout: 5000 | |
database: ":memory:" | |
verbosity: quiet |
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import sys | |
import datetime | |
import time | |
import os | |
from stat import * | |
import commands | |
def watch(dir, command): |
<!doctype html> | |
<title>Site Maintenance</title> | |
<style> | |
body { text-align: center; padding: 150px; } | |
h1 { font-size: 50px; } | |
body { font: 20px Helvetica, sans-serif; color: #333; } | |
article { display: block; text-align: left; width: 650px; margin: 0 auto; } | |
a { color: #dc8100; text-decoration: none; } | |
a:hover { color: #333; text-decoration: none; } | |
</style> |
# This is a reasonably well-behaved helper for command-line scripts needing to ask a simple yes/no question. | |
# It optionally accepts a prompt and a default answer that will be returned on enter keypress. | |
# It keeps asking and echoes the answer on the same line until it gets y/n/Y/N or enter. | |
# I tried to get Highline to behave like this directly, but even though it's sophisticated, I didn't like the result. | |
# This isn't especially elegant, but it is straightforward and gets the job done. | |
require 'highline/import' | |
def yesno(prompt = 'Continue?', default = true) | |
a = '' | |
s = default ? '[Y/n]' : '[y/N]' |