switch_to_blogしてもカスタム投稿タイプは切り替わらない。
https://ja.forums.wordpress.org/topic/5939
This file contains hidden or 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
sass --style expanded --watch hoge.scss:hoge.css |
This file contains hidden or 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
@mixin min($width: 960px) { | |
@media only screen and (min-width: $width) { | |
@content; | |
} | |
} | |
@mixin max($width: 959px) { | |
@media only screen and (max-width: $width) { | |
@content; | |
} |
This file contains hidden or 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
ACFよりも自由度が高い | |
グループ化とグループ追加ができる。 | |
↓ここが詳しい | |
http://kotori-blog.com/wordpress/customfieldtemplate_add/ |
This file contains hidden or 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
var getMedian = function(arr) { | |
var half = Math.floor(arr.length / 2); | |
var temp = arr.sort(function(a, b) { return a - b; }); | |
console.log(temp); | |
if ( temp.length % 2 ) { | |
return temp[half]; | |
} else { | |
return ( temp[half - 1] + temp[half] ) / 2; | |
} |
This file contains hidden or 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
UPDATE wp_posts SET post_content=REPLACE (post_content,'href="/','href="/hoge/'); |
This file contains hidden or 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
$(function() { | |
var limit = new Date("Feb 1,2016 00:00:00"), | |
$times = [ | |
$('#date10'), $('#date01'), | |
$('#hour10'), $('#hour01'), | |
$('#minute10'), $('#minute01'), | |
$('#second10'), $('#second01') | |
]; | |
var updateTime = function(timeArray) { |
This file contains hidden or 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
// 文字列を強制する | |
$name = isset($_POST['name']) && is_string($_POST['name']) ? $_POST['name'] : ''; |
This file contains hidden or 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
;(function () { | |
// 変数は一番上ででまとめて宣言 | |
var i, | |
j, | |
k; | |
// functionの()はくっつける | |
// ,のあとはスペース | |
// ()の内側はすべてくっつける | |
function hoge(value1, value2) { |
This file contains hidden or 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
app.use(bodyParser.json()); | |
app.use(bodyParser.urlencoded({ extended: true })); | |
app.post('/send/', function(req, res){ | |
var s1 = req.body.s1 ? req.body.s1: 0, | |
s2 = req.body.s2 ? req.body.s2: 0, | |
s3 = req.body.s3 ? req.body.s3: 0; | |
io.sockets.emit('socket_sensor', [s1, s2, s3]); | |
res.send('OK'); |