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
yum install -y httpd mariadb-server mariadb-devel php-mysql php php-gd php-mbstring | |
curl -O https://ja.wordpress.org/wordpress-4.1.1-ja.tar.gz | |
tar zxf wordpress-4.1.1-ja.tar.gz -C /var/www/html | |
chown -R apache. /var/www/html/wordpress | |
systemctl start httpd | |
systemctl start mariadb | |
mysql -uroot -e 'create database wordpress' |
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 SomeClass | |
def greet | |
"Hello." | |
end | |
end | |
describe "allow_any_instance_of" do | |
before { allow_any_instance_of(SomeClass).to receive(:greet).and_call_original } | |
context "when calling Command#greet" do | |
it "pass the test" do |
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 | |
# | |
# Usage: | |
# ruby sleep_server.rb [options] | |
# | |
# Options: | |
# -p port (default: 80) | |
# -b bind_address (default: 0.0.0.0) | |
# -s sleep_seconds (default: 5) |
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
require "openssl" | |
pem = DATA.read | |
begin | |
OpenSSL::X509::Certificate.new(pem) | |
puts "Valid!" | |
rescue | |
puts "Invalid!" | |
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
# ==== Emojis ==== | |
# 🐛 :bug: バグ修正 | |
# 👍 :+1: 機能改善 | |
# ✨ :sparkles: 部分的な機能追加 | |
# 🎉 :tada: 盛大に祝うべき大きな機能追加 | |
# ♻️ :recycle: リファクタリング | |
# 🚿 :shower: 不要な機能・使われなくなった機能の削除 | |
# 💚 :green_heart: テストやCIの修正・改善 |
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
# frozen_string_literal: true | |
require 'google/apis/analytics_v3' | |
require 'google/api_client/auth/key_utils' | |
module GoogleServices | |
class Analytics | |
attr_reader :start_date, :end_date | |
def initialize(start_date: nil, end_date: nil) |
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
# frozen_string_literal: true | |
require "sinatra" | |
module Sinatra | |
module Mount | |
def mount(app, path = "/#{app.name.downcase}") | |
%i(get post put delete patch options).each do |method| | |
self.send(method, "#{path}*") do | |
app.call( |
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 | |
# frozen_string_literal: true | |
# Guess BigQuery table schema automatically from JSON Lines | |
# | |
# example: | |
# $ cat source.jsonl | |
# {"required":123,"optional":true,"nested":{"required":1234,"optional":"yes"},"array":[0,1,2,3,4]} | |
# {"required":456,"optional":false,"nested":{"required":1234,"optional":"yes","nested":{"prop":1}},"array":[5,6,7,8,9]} | |
# {"required":789,"nested":{"required":1234,"optional":"yes","additional":"added"},"array":[]} |
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 | |
$LOAD_PATH.unshift("../../lib", __FILE__) | |
require "./runner" | |
Takoyaki::Runner.new(ARGV).run |
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 <stdio.h> | |
int main(void) { | |
printf("Hello, world!"); | |
return 0; | |
} | |
/* | |
$ gcc -c hello.c | |
$ gobjdump -d -M intel hello.o |