Skip to content

Instantly share code, notes, and snippets.

@hasen
hasen / wp-config.php
Created October 23, 2016 10:02
wp-config.phpに設定する値をAPIから取得する.
<?php
define('AUTH_KEY', '*.,GARD<1<dKO+j_ZgJ|a4GCzke-l#ug6X4gAuhk(!9cF]1n)[p68zywi]Q9=q5U');
define('SECURE_AUTH_KEY', '|LaeyNZ`Z*fPIIoA[96Bl;gQFSK M5/T*dT?Q)2?G6sx.^+#[m>RY:jcw0mQVp;_');
define('LOGGED_IN_KEY', '|62aVi[ )5sK_%^BZF-}s+#.ui|<n[-1#)yZ-Nwrr{023?JV+qC5sQ@ldKgJLAUE');
define('NONCE_KEY', 'w/I#-W H(<6,V8lb39UG<#;e;Rn/c-sg$*M^bg5 S![|#6Kh1)uLL6HiNFmBE2&a');
define('AUTH_SALT', 'CEkJyW+Go!Uv>5Nr=W>Qx-5yrfm4_n42xdG2EjA-:`;eL{:5XJpl,i: @$Jv`zV4');
define('SECURE_AUTH_SALT', 'I8#,;!*y.6JO3{{T4R+z8$4j>6>;<g)>tjG=cJ^A7>k<Cge+Q7pu X?F)T)u6KT(');
define('LOGGED_IN_SALT', '|RvWJiO&RKdFX;#[r{<Zy~G94?1NXw@F.+Z$7K+[mybzhp0r_+YiW7MSCyfpf{%f');
define('NONCE_SALT', 'okp^_FlJP(Z]`m-ZeGaA|0kdiJcphqD)>XbcE{,5[rNkZJTWf9,H)UFOC`I-<-+b');
@hasen
hasen / .vimrc
Created October 10, 2016 03:45
Vim function format with PSR
function format_psr()
!php-cs-fixer fix % --level=psr2
!php-cs-fixer fix % --fixers=hpdoc_indent,phpdoc_params,short_array_syntax,multiline_array_trailing_comma,operators_spaces
!gsed -i 's/, ]/,]/g' %
endfunction
command format_psr :call format_psr()
@hasen
hasen / test.js
Created August 13, 2016 07:18
選択されているチェックボックスの値をカンマ区切りで取得する.
var hoge_list = $("input[id^=hoge_checkbox_]:checked").map(function () {
return $(this).val();
}).get().join(", ");
@hasen
hasen / apache.conf
Created May 5, 2016 07:09
ubuntu v12.04で"AH01796: AuthType Digest configured without corresponding module"というエラーが出たので対応
-- <Directory /PATH/TO/PUBLIC>
-- AuthType Digest
-- AuthName "AUTH_NAME"
-- AuthUserFile "/PATH/TO/DIGEST_FILE"
-- Require valid-user
-- </Directory>
++ <Location />
++ AuthType Digest
++ AuthName "AUTH_NAME"
@hasen
hasen / mail.php
Last active December 13, 2015 02:08
OSX (El Capitan)のローカル環境でメール送信テスト.(2/2)
<?php
++ "driver" => "smtp",
++ "host" => "smtp.gmail.com",
++ "port" => 587,
@hasen
hasen / main.cf
Created December 12, 2015 08:51
OSX (El Capitan)のローカル環境でメール送信テスト.(1/2)
++ relayhost = [smtp.gmail.com]:587
++
++ # SASL Authentication
++ smtp_sasl_auth_enable = yes
++ smtp_sasl_password_maps = hash:/etc/postfix/gmail_passwd
++ smtp_sasl_security_options = noanonymous
++ smtp_sasl_mechanism_filter = plain
++
++ # TLS Settings
++ smtp_use_tls = yes
@hasen
hasen / index.twig
Created November 25, 2015 01:20
Laravel v5.1.24でtwigを使うために,パッケージを追加した.
{% for i in 0..10 %}
{{i}}
{% endfor %}
@hasen
hasen / app.php
Last active November 25, 2015 01:26
Laravel v5.1.24でtwigを使うために,パッケージを追加した.
<?php
"providers" => [
"TwigBridge\ServiceProvider",
@hasen
hasen / olark_localize.js
Created October 21, 2015 17:27
設定以外でolarkのポップアップをローカライズする.
$(function () {
setTimeout(function () {
if ($("#habla_oplink_a").length > 0) {
$("#habla_oplink_a").html("ご相談下さい!");
}
if ($("#habla_offline_message_span").length > 0) {
$("#habla_offline_message_span").html("メッセージを入力して下さい。");
}
if ($("#habla_name_input").length > 0) {
$("#habla_name_input").attr("placeholder", "お名前");
@hasen
hasen / index.html
Last active October 17, 2015 20:19
Facebook連携でシェアボタンが表示されなかったので,対応した.
-- <div data-href="https://developers.facebook.co" data-layout="button_count"></div>
++ <div class="fb-share-button" data-href="https://developers.facebook.co" data-layout="button_count"></div>