Skip to content

Instantly share code, notes, and snippets.

@tecking
tecking / force-https-htaccess.txt
Created November 28, 2018 08:45 — forked from fillipetech/force-https-htaccess.txt
Force https #https #security
RewriteEngine On
RewriteCond %{HTTPS} off
# First rewrite to HTTPS:
# Don't put www. here. If it is already there it will be included, if not
# the subsequent rule will catch it.
RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# Now, rewrite any request to the wrong domain to use www.
# [NC] is a case-insensitive match
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule .* https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

これは何

Adobe Kuler からいい感じの色の組み合わせを抜いてくるスクリプト です。 Kuler API というのがあったらしいけど今見たら提供されてなかったので書いた。 自己責任で使ってください。

getHexBackgroundColor

http://stackoverflow.com/questions/3048838/jquery-css-color-value-returns-rgb をそのままコピーしてます。

@tecking
tecking / replace-siteurl.php
Created May 12, 2013 06:57 — forked from wokamoto/replace-siteurl.php
php replace-siteurl.php http://www.example.com/ /path/to/wordpress/
#!/usr/bin/php
<?php
switch($argc) {
case 1:
case 2:
echo "please input new site url and wp directory name!\n";
exit();
default:
$old_site = isset($argv[3]) ? $argv[3] : '';
$path = $argv[2];