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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Simple Map</title> | |
<meta name="viewport" content="initial-scale=1.0"> | |
<meta charset="utf-8"> | |
<style> | |
</style> | |
</head> | |
<body> |
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
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> | |
<header class="entry-header"> | |
<?php | |
if ( has_post_thumbnail() ) : | |
the_post_thumbnail(); | |
else : | |
print_post_no_image_thumbnail(); | |
endif; | |
?> |
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 | |
wp option update siteurl 'https://stg.example.com/wordpress' | |
wp option update home 'https://stg.example.com/wordpress' | |
wp option update blogname 'foo' | |
wp option update blogdescription '' | |
wp option update timezone_string 'Asia/Tokyo' | |
wp option update date_format 'Y/m/d' | |
wp option update time_format 'H:i' | |
wp option update permalink_structure '/blog/%year%/%monthnum%/%day%_%post_id%.html' |
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 | |
# Delete all categories. | |
wp term list category --field=term_id | xargs wp term delete category | |
# Delete all post tags. | |
wp term list post_tag --field=term_id | xargs wp term delete post_tag | |
# Delete all posts. | |
wp post delete --force $(wp post list --format=ids) |
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 | |
cd $HOME | |
mkdir local/bin local/tmp | |
cd ~/local/tmp | |
curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar | |
chmod +x wp-cli.phar | |
mv wp-cli.phar ~/local/bin/wp |
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
# rubocop:disable AsciiComments, EmptyLines, LineLength, Semicolon, VariableNumber, Lambda, Proc, RedundantBlockCall, ShadowingOuterLocalVariable, ShadowedArgument | |
# | |
# 「アジャイル時代のオブジェクト脳のつくり方 Rubyで学ぶ究極の基礎講座」の7章のソースコード。 | |
# | |
# |
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
<?php | |
function extend_date_archives_add_rewrite_rules() { | |
add_rewrite_rule( 'category/([^/]+)/date/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/feed/(feed|rdf|rss|rss2|atom)/?$', 'index.php?category_name=$matches[1]&year=$matches[2]&monthnum=$matches[3]&day=$matches[4]&feed=$matches[4]', 'top' ); | |
add_rewrite_rule( 'category/([^/]+)/date/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/?$', 'index.php?category_name=$matches[1]&year=$matches[2]&monthnum=$matches[3]&day=$matches[4]', 'top' ); | |
add_rewrite_rule( 'category/([^/]+)/date/([0-9]{4})/([0-9]{1,2})/?$', 'index.php?category_name=$matches[1]&year=$matches[2]&monthnum=$matches[3]', 'top' ); | |
add_rewrite_rule( 'category/([^/]+)/date/([0-9]{4})/?$', 'index.php?category_name=$matches[1]&year=$matches[2]', 'top' ); | |
} | |
add_action('wp_loaded', 'extend_date_archives_add_rewrite_rules'); |
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' | |
require 'net/http' | |
https = Net::HTTP.new('www.google.co.jp', 443) # address, port | |
https.use_ssl = true | |
https.verify_mode = OpenSSL::SSL::VERIFY_NONE | |
# https.verify_mode = OpenSSL::SSL::VERIFY_PEER | |
# https.ca_file = '/etc/ssl/cert.pem' | |
https.start do | |
response = https.get('/') # path |
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
'use strict'; | |
const MyStorage = function(app) { | |
this.app = app; | |
this.storage = localStorage; | |
this.data = JSON.parse(this.storage[this.app] || '{}'); | |
}; | |
MyStorage.prototype = { | |
getItem: function(key) { |
NewerOlder