Skip to content

Instantly share code, notes, and snippets.

View kaoru-fukusato's full-sized avatar

かおちんサポート・メモ帳 kaoru-fukusato

View GitHub Profile
@kaoru-fukusato
kaoru-fukusato / PHP 簡易掲示板
Created March 13, 2018 04:58
コピペで学べるプログラミング基本3-1
function show_form(){
global $script;
global $data_dir;
if(isset($_GET['response'])){
$response = htmlspecialchars($_GET['response'], ENT_QUOTES, 'UTF-8');
$contents_file = $data_dir."data/{$response}.txt";
$pointer = fopen($contents_file,'r');
@kaoru-fukusato
kaoru-fukusato / CSS その1
Created March 13, 2018 08:54
コピペで学べるプログラミング基本3-2
/*HTML*/
<div class="box1">
<p>ここに文章</p>
</div>
/*CSS*/
.box1 {
padding: 0.5em 1em;
margin: 2em 0;
border: double 5px #4ec4d3;
@kaoru-fukusato
kaoru-fukusato / CSS その2
Created March 13, 2018 08:59
コピペで学べるプログラミング基本3-3
/*HTML*/
<div class="box2">
<p>ここに文章</p>
</div>
/*CSS*/
.box2 {
padding: 0.5em 1em;
margin: 2em 0;
background: #f0f7ff;
@kaoru-fukusato
kaoru-fukusato / CSS その3
Last active March 13, 2018 09:04
コピペで学べるプログラミング基本3-4
/*HTML*/
<div class="box3">
<p>ここに文章</p>
</div>
/*CSS*/
.box3 {
padding: 0.5em 1em;
margin: 2em 0;
color: #232323;
@kaoru-fukusato
kaoru-fukusato / CSS その4
Created March 13, 2018 09:11
コピペで学べるプログラミング基本3-4
/*HTML*/
<div class="box4">
<p>ここに文章</p>
</div>
/*CSS*/
.box4 {
padding: 0.5em 1em;
margin: 2em 0;
color: #ff7d6e;
@kaoru-fukusato
kaoru-fukusato / CSS その5
Created March 13, 2018 09:14
コピペで学べるプログラミング基本3-5
/*HTML*/
<div class="box5">
<p>ここに文章</p>
</div>
/*CSS*/
.box5 {
padding: 0.5em 1em;
margin: 2em 0;
color: #00BCD4;
@kaoru-fukusato
kaoru-fukusato / 高速化パート2
Created April 5, 2018 01:38
【WP】プラグインなしで高速化
/*.htaccess_code_startキャッシュを有効化して、WP高速化*/
# キャッシュを有効にする
Header set Cache-Control "max-age=2628000, public"
# キャッシュ設定
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access 1 year"
ExpiresByType image/jpeg "access 1 year"
@kaoru-fukusato
kaoru-fukusato / コメントの不要な個所を変更・削除
Last active April 5, 2018 01:51
コメントの不要な個所をカット【WP】
/*function.phpへ*/
# 不要な文言を変更・削除
// メールアドレスが公開されることはありませんの文言を変更
add_filter('comment_form_defaults', 'change_comment_email_notes');
function change_comment_email_notes( $defaults ) {
$defaults['comment_notes_before'] = '<p class="comment-notes"><span id="email-notes">メールアドレスは公開されることはありません。</span></p>';
@kaoru-fukusato
kaoru-fukusato / 一番簡単なgzip圧縮
Created April 5, 2018 02:06
.htaccessファイルでgzip圧縮するのが簡単
<IfModule mod_deflate.c>
SetOutputFilter DEFLATE
#古いブラウザ対策
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch \bMSIE\s(7|8) !no-gzip !gzip-only-text/html
#画像は圧縮しない GIF、JPEG、PNG、ICO
SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png|ico)$ no-gzip dont-vary
@kaoru-fukusato
kaoru-fukusato / サイト高速化 その3
Created April 5, 2018 02:38
サイト高速化 その3
// キャッシュの設定をする
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]