- WordPressがデフォルトで読み込んでるjQueryは活用(プラグインなど使うとどうしてもjQuery依存してるものが出てくる)
- それでもバンドルツール入れないとシンドイ
- jQueryに依存してるけど、便利なSelect2をadmin画面に導入したい
// webpack.config.js
externals: {
jquery: 'jQuery'
}
version: "3.7" | |
networks: | |
backend: | |
frontend: | |
volumes: | |
app: | |
db_data: |
version: '2' | |
services: | |
api: | |
volumes: | |
- "nfsmount:${CONTAINER_DIR}" | |
volumes: | |
nfsmount: | |
driver: local | |
driver_opts: |
// webpack.config.js
externals: {
jquery: 'jQuery'
}
<html> | |
<head> | |
<style> | |
body, a, input {font-family:sans-serif;} | |
</style> | |
</head> | |
<body style="font-family:sans-serif"> | |
%%=now()=%% | |
<h1>JSON Parse with GTL</h1> | |
%%[ |
fetch(ajax_url, { | |
method: 'POST', | |
credentials: 'same-origin', | |
headers: new Headers({'Content-Type': 'application/x-www-form-urlencoded'}), | |
body: 'action=zget_profile_user' | |
}) | |
.then((resp) => resp.json()) | |
.then(function(data) { | |
if(data.status == "success"){ | |
_this.setState({loaded:true,user:data.user}); |
<?php | |
/** | |
* Make terms retrieved by wp_get_object_terms() organized hierarchically. | |
* | |
* Use this function instead of wp_get_object_terms() to get a hierarchically | |
* structured array or term data. | |
* | |
* This function takes the terms returned by wp_get_object_terms() and organizes | |
* them into a hierarchical array with the parent's children (and grandchildren) |
/** | |
* Remove acentos de caracteres | |
* @param {String} stringComAcento [string que contem os acentos] | |
* @return {String} [string sem acentos] | |
*/ | |
function removerAcentos( newStringComAcento ) { | |
var string = newStringComAcento; | |
var mapaAcentosHex = { | |
a : /[\xE0-\xE6]/g, | |
e : /[\xE8-\xEB]/g, |
Configure local wildcard DNS server
sudo apt-get install dnsmasq
/etc/NetworkManager/NetworkManager.conf
and comment out (#
) the line that reads dns=dnsmasq
. Restart NetworkManager afterwards: sudo restart network-manager
./etc/dnsmasq.conf
, and adding the line listen-address=127.0.0.1
./etc/dnsmasq.d
(eg. /etc/dnsmasq.d/dev
), and add the line address=/dev/127.0.0.1
to have dnsmasq resolve requests for *.dev domains. Restart Dnsmasq: sudo /etc/init.d/dnsmasq restart
.source: http://brunodbo.be/blog/2013/04/setting-up-wildcard-apache-virtual-host-wildcard-dns
/* Minifies HTML and removes comments (except IE tags and comments within script tags) | |
* | |
* To disable compression of code portions, use '<!--wp-html-compression no compression-->' tag | |
* | |
* @see http://forrst.com/posts/Wordpress_Minify_output_HTML-29q | |
* @see http://www.intert3chmedia.net/2011/12/minify-html-javascript-css-without.html | |
*/ | |
class WP_HTML_Compression | |
{ | |
// Settings |
Locate the section for your github remote in the .git/config
file. It looks like this:
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = git@github.com:joyent/node.git
Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/*
to this section. Obviously, change the github url to match your project's URL. It ends up looking like this: