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
// Visit http://abehiroshi.la.coocan.jp/ | |
// then execute these lines via DevTools Console. | |
let e = document.createElement('img'); | |
e.src = 'https://gist.github.com/assets/25242343/14cbd41c-1ec4-4f13-8bce-ae8a726b2524'; | |
e.style.cssText = 'width: 60%; margin-left: 20%; margin-right: 20%; position: absolute; filter: drop-shadow( 0 0 10px white );'; | |
let eHead = document.getElementsByTagName('head')[0]; | |
eHead.parentNode.insertBefore( e, eHead.nextElementSibling ); |
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
{ | |
// See https://go.microsoft.com/fwlink/?LinkId=733558 | |
// for the documentation about the tasks.json format | |
"version": "2.0.0", | |
"tasks": [ | |
{ | |
"label": "echo", | |
"type": "shell", | |
"presentation": { | |
"reveal": "always", |
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
{ | |
BOOTH_ORDER : | |
{ | |
captures : { | |
subject : { | |
unpaid : { | |
rule : '^.*((お支払い未完了)).*$', | |
rule_opt : 'gsm', | |
default_value : '支払済み', | |
value : '支払未完了' |
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
diff --git "a/vendor/opengraph/OpenGraph.php" "b/vendor/opengraph/OpenGraph.php" | |
index aa16e55..92ccdff 100644 | |
--- "a/vendor/opengraph/OpenGraph.php" | |
+++ "b/vendor/opengraph/OpenGraph.php" | |
@@ -61,6 +61,20 @@ class OpenGraph implements Iterator | |
curl_setopt($curl, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']); | |
$response = curl_exec($curl); | |
+ $suspicious_charset = ''; | |
+ preg_match( |
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
$ ls -l test.jpg | |
-rwxrwxrwx 1 hoge hoge 756448 Sep 9 13:36 test.jpg | |
$ time ( for i in `seq 10000`; do wc -c test.jpg > /dev/null;done ) | |
real 0m14.854s | |
user 0m4.216s | |
sys 0m4.275s | |
$ time ( for i in `seq 10000`; do stat -c%s test.jpg > /dev/null;done ) | |
real 0m18.041s |
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
/* | |
WordPressの wptexturize とか wpautop とか呼ばれる機能停止して | |
ダブルクオートとかダッシュとかの自動変換を止めるねん | |
Gutenbergにも対応する版 | |
*/ | |
call_user_func( function() { | |
add_filter( 'run_wptexturize', '__return_false', PHP_INT_MAX ); | |
// 勝手に改行を <p></p> にしたりするのを止める | |
add_action('init', function() { | |
remove_filter('the_title', 'wpautop'); |
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
// safe_hosts.conf | |
geo $safe_hosts { | |
default 0; | |
127.0.0.1 1; | |
# : etc. | |
} | |
// is_wordpress_admin_page.conf | |
map $uri $is_wordpress_admin_page { | |
default 0; |
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
# Nginx で | |
# www.hogehoge.com -> hogehoge.com | |
# http://{www.}hogehoge.com -> https://hogehoge.com | |
# に一気に正規化する設定の例 | |
# server コンテキスト | |
set $redirect_canon_url ""; | |
set $canon_host $host; | |
if ( $host ~ ^www\.(.*)$ ) { |
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 | |
: <<__WHAT_IS_THIS__ | |
Cloudflareの公開情報から以下のファイルを作成する。 | |
/etc/cron.daily/ に置いてね | |
* /etc/nginx/conf.d/00-trusted_proxies.conf | |
Cloudflareからのアクセスの場合、 | |
X-Cloudflare-Proxy-IP から | |
リモートIPアドレスをHTTPヘッダに引き継がせる |
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
# local DNS stub listener を無効にする | |
if lsof -i:53 | grep -q systemd-resolve; then | |
sed -i \ | |
-e 's|^#\(DNSStubListener=\).*$|\1no|' \ | |
/etc/systemd/resolved.conf | |
resolve_conf_real_path=$(readlink /etc/resolv.conf) | |
# なおかつ /etc/resolv.conf を stub ではないものを参照させる | |
if [[ "$resolve_conf_real_path" =~ stub-resolv.conf$ ]]; then | |
( | |
cd /etc |
NewerOlder