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
<!DOCTYPE html> | |
<html> | |
<head> | |
<base target="_top"> | |
<link rel="stylesheet" href="https://ssl.gstatic.com/docs/script/css/add-ons1.css"> | |
<style type="text/css"> | |
<!-- | |
button {margin: 5px 5px;} | |
td {padding: 11px 5px;} | |
table {width: 100%;} |
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
require 'pact/consumer/rspec' | |
Pact.service_consumer "client" do | |
has_pact_with "microservice" do | |
mock_service :microservice do | |
port 3001 # 適当なポート | |
end | |
end | |
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
# frozen_string_literal: true | |
def fizzbuzz(number:) | |
return 'fizzbuzz' if (number % 15).zero? | |
return 'buzz' if (number % 5).zero? | |
return 'fizz' if (number % 3).zero? | |
number | |
end | |
1..15.times do |index| |
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
#! /usr/bin/env ruby | |
require 'net/http' | |
require 'fileutils' | |
users = ["MacoTasu"] #ここにユーザを追加してね | |
users.each do |user| | |
uri = URI.parse("https://github.com/#{user}.keys") | |
File.open('authrized_keys','a') do |file| | |
Net::HTTP.get(uri).split("\n").each do |key| | |
file.puts("#{key}") |
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
# coding: utf-8 | |
SUDO_GID=27 | |
node.validate! do | |
{ | |
sudoers: { | |
users: array_of({ | |
name: string, | |
password: string, | |
github_name: string, |
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
<?php | |
require('./ParallelFor.php'); | |
system('date'); | |
$executor = function($var) { | |
$link = mysql_connect('127.0.0.1:3306', 'root', ''); | |
if (!$link) { | |
die('接続できませんでした: ' . mysql_error()); | |
} | |
print '接続に成功しました'; |
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
[1] pry(main)> module Hoge | |
[1] pry(main)* def say | |
[1] pry(main)* p "hoge" | |
[1] pry(main)* end | |
[1] pry(main)* end | |
=> :say | |
[2] pry(main)> module Fuga | |
[2] pry(main)* def say | |
[2] pry(main)* p "fuga" | |
[2] pry(main)* 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/sh | |
mysqldump -h $MYSQL_HOST -u$MYSQL_USER_NAME -p$MYSQL_PASSWORD --single-transaction --master-data=2 $DB_NAME | gzip > mysqldump.sql.gz | |
date_str=`date +"%Y%m%d%I%M"` | |
aws s3 mv mysqldump.sql.gz s3://****-mysqldump/"${date_str}".sql.gz |
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
DROP TABLE IF EXISTS `entries`; | |
CREATE TABLE `entries` ( | |
`id` INTEGER unsigned NOT NULL auto_increment, | |
`user_id` INTEGER, | |
`title` VARCHAR(191) NOT NULL, | |
`created_at` datetime, | |
`updated_at` datetime, | |
INDEX `user_id_idx` (`user_id`), | |
PRIMARY KEY (`id`) |
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
use common::sense; | |
use Getopt::Long; | |
local $| = 1; | |
GetOptions(\my %opts, qw/ | |
prod | |
/); | |
my $prod = $opts{'prod'}; |
NewerOlder