Skip to content

Instantly share code, notes, and snippets.

View Asuforce's full-sized avatar
🍊
ʕ ◔ϖ◔ʔ

Shun Nishitsuji Asuforce

🍊
ʕ ◔ϖ◔ʔ
View GitHub Profile
<?php
function custom_search($search, $wp_query) {
global $wpdb;
//サーチページ以外だったら終了
if (!$wp_query->is_search)
return $search;
if (!isset($wp_query->query_vars))
return $search;
@Asuforce
Asuforce / file2.txt
Last active November 24, 2015 15:59
Laravelで外部キー制約のあるテーブルを操作する。 ref: http://qiita.com/Asuforce/items/2c7cf0c95225083a2af5
$ php artisan db:seed
@Asuforce
Asuforce / file0.txt
Created November 28, 2015 07:46
Githubを二段階認証にして、弾かれた時にする一番ラクな対策 ref: http://qiita.com/Asuforce/items/c2fa32e78d0d6fcf015d
machine github.com
login [あなたのGitHubのID]
password [2で生成したtoken]
@Asuforce
Asuforce / file0.txt
Last active January 12, 2017 06:42
zshでvim+Tabでエラーになる時の対処法 ref: http://qiita.com/Asuforce/items/28b287fdb933d1985e15
vim
configure: WARNING: This bison version is not supported for regeneration of the Zend/PHP parsers (found: 2.3, min: 204, excluded: 3.0).
configure: WARNING: This bison version is not supported for regeneration of the Zend/PHP parsers (found: none, min: 204, excluded: 3.0).
/var/tmp/php-build/source/5.6.17/ext/opcache/ZendAccelerator.c:397:28: warning: assigning to 'char *' from 'const char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
CG(interned_empty_string) = accel_new_interned_string("", sizeof(""), 0 TSRMLS_CC);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ext/opcache/.libs/opcache.a(shared_alloc_shm.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ext/opcache/.libs/opcache.a(shared_alloc_shm.o) has no symbols
/Applications/Xcode.app/Co
@Asuforce
Asuforce / index.js
Created September 11, 2018 14:11
LIFF-handson
window.onload = function (e) {
liff.init(function (data) {
initializeApp(data);
});
};
function initializeApp(data) {
liff.getProfile().then(function (profile) {
var name = profile.displayName;
document.getElementById('name').textContent = name;

Windows 10 を高速化!目に見えて効果があった5つの設定とは?

  • 汎用性がある。間違った設定方法を列挙しているのも良い。
  • 記事にはないが 「スタートアップ」の設定は CCleaner を使うと楽。

PCゲームのフレームレートが高くてもカクつく症状を改善するためにやった4つの対処方法 Flame of Heavens

  • Game Booster の導入
  • セキュリティソフトで除外設定
  • NVIDIA コントロールパネル
    • スレッドした最適化
  • オフにするとカクつきが改善できる可能性がある
@Asuforce
Asuforce / comprehension.md
Last active November 6, 2019 03:08
内包記法の練習
>>> c = {str(i):i+random.randrange(10) for i in range(10)}
>>> c
{'0': 6, '1': 6, '2': 7, '3': 3, '4': 11, '5': 5, '6': 13, '7': 14, '8': 14, '9': 17}
>>> [l for l,r in sorted(c.items(), key=lambda x:x[1], reverse=True)][:16-len(c)]
['9', '7', '8', '6', '4', '2']

ref: https://qiita.com/ogrew/items/20a3d9a7edf1f7bd6a2c

Envoy

TL;DR

Envoy は microservice を行う上で便利な機能を提供する。 microservice を行う上で Circuit Breaker などの必要機能を言語毎に提供するのはコストがかかるため、その役割を Envoy が担う。

Envoy とは (外交)使節という意味

Ex.

  • Nginx => Web server の機能を提供する sidecar
  • Envoy => microservice の便利機能を提供する sidecar