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
// this will effect all relationship fields | |
// if you only want to effect specific fields | |
// see https://www.advancedcustomfields.com/resources/acf-fields-relationship-query/ | |
add_filter('acf/fields/relationship/query', 'relationship_only_own_posts', 10, 3); | |
function relationship_only_own_posts($args, $field, $post_id) { | |
// ACFのcourseの値で、表示する前提条件を絞る | |
$args['meta_key'] = 'course'; | |
$post = get_fields($post_id); | |
$post_course = $post["course"]; |
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
function my_acf_load_field( $field ) { | |
if ( ! empty ( $_GET[$field['name']] )) { | |
$field['default_value'] = $_GET[$field['name']]; | |
} | |
return $field; | |
} | |
add_filter('acf/load_field', 'my_acf_load_field'); | |
remove_filter( 'the_content', '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
# -*- coding: utf-8 -*- | |
import re | |
import json | |
import requests | |
url = 'https://store.nintendo.co.jp/customize.html' | |
content = requests.get(url).text | |
if re.search(r'\bSOLD\s+OUT\b', content): | |
print('Nintendo Switch SOLD OUT.') |
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
// MutationObserver | |
// https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver | |
// select the target node | |
var target = document.querySelector('.status-list'); | |
// create an observer instance | |
var observer = new MutationObserver(function(mutations) { | |
// var targetContentsList = document.querySelectorAll('.status__content:not(.ox-playflagged):not(.muted)'); |
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
window.onerror = function(mes,file,num){ | |
track_jserror(mes,file,num); | |
return false; | |
} | |
function track_jserror(mes,file,num){ | |
if("_gaq" in window){ | |
_gaq.push(['_trackEvent', 'Javascript', 'Error', [ | |
"file : " + file, | |
"line : " + num, | |
"message : " + mes |
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
# debug function | |
log = (obj) -> Titanium.API.log obj | |
Titanium.UI.setBackgroundColor '#000' | |
class TabGroup | |
constructor: () -> | |
@tabGroup = Titanium.UI.createTabGroup() | |
return @tabGroup |
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
dev_appserver.py --port=8080 . |
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
/* | |
app | |
Copyright (c) 2016 CALIL Inc. | |
This software is released under the MIT License. | |
http://opensource.org/licenses/mit-license.php | |
*/ | |
'use strict' |
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
browser-sync start --proxy http://127.0.0.1:8080/ --files "**/*.html,**/*.js,**/*.css" |
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
<!--[if !IE]><!--> | |
<form action="/upload" method="post" enctype="multipart/form-data"> | |
<div class="fileinput fileinput-new" data-provides="fileinput"> | |
<div class="input-group"> | |
<div class="form-control uneditable-input span3" data-trigger="fileinput"><i class="glyphicon glyphicon-file fileinput-exists"></i> <span class="fileinput-filename">{% if form.value!='' %}{{form.value}}{% endif %}</span></div> | |
<span class="input-group-addon btn btn-default btn-file"><span class="fileinput-new">ファイルを選択</span><span class="fileinput-exists">変更</span><input type="file" name="{{form.name}}" onchange="fileupload(event);"></span> | |
<a href="#" class="input-group-addon btn btn-default fileinput-exists" data-dismiss="fileinput">選択解除</a> | |
</div> | |
</div> | |
</form> |