$ cat > .env << EOL
foo=foo
foobar="foo bar"
EOL
$ env grep -v '^#' .env | xargs -d '\n' -t
echo foo=foo foobar="foo bar"
env: ‘bar"’: No such file or directory
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 notify_post ($post_id) { | |
| $request = new WP_REST_Request('GET', '/wp/v2/posts/' . $post_id); | |
| $response = rest_do_request($request); | |
| $status = $response->get_status(); | |
| $data = $response->get_data(); | |
| $callback_uri = 'https://example.com'; | |
| wp_safe_remote_post($callback_uri, array('body' => json_encode($data))); | |
| } | |
| add_action('post_updated', 'notify_post'); |
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
| // https://wordpress.org/gutenberg/ | |
| (wp => { | |
| const el = wp.element.createElement | |
| const __ = wp.i18n.__ | |
| wp.blocks.registerBlockType( 'plugins/gutenvue', { | |
| title: __('Gutenberg: VueJS', 'gutenvue'), | |
| category: 'widgets', | |
| supportHTML: false, | |
| attributes: { |
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
| alias headers='curl -I -s -X GET' |
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
| // Array utils ///////////////////////////////////////////////////////////////// | |
| export const combine = (...arrays) => [].concat(...arrays) | |
| export const compact = arr => arr.filter(Boolean) | |
| export const contains = (() => Array.prototype.includes | |
| ? (arr, value) => arr.includes(value) | |
| : (arr, value) => arr.some(el => el === value) | |
| )() |
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
| const h2 = require('http2') | |
| const { run, send } = require('micro') | |
| const cert = require('openssl-self-signed-certificate') | |
| const { PORT = 3443 } = process.env | |
| const options = { | |
| key: cert.key, | |
| cert: cert.cert, | |
| passphrase: cert.passphrase | |
| } |
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
Show hidden characters
| { | |
| "Reset": { | |
| "prefix": "reset", | |
| "scope": "stylus", | |
| "body": [ | |
| "*", | |
| "*::before", | |
| "*::after", | |
| " box-sizing border-box", | |
| "", |
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
| const url = require('url') | |
| const fs = require('fs') | |
| const path = require('path') | |
| const { send } = require('micro') | |
| const mime = require('mime') | |
| module.exports = async (req, res) => { | |
| const parseUrl = url.parse(req.url) | |
| let file = `.${parseUrl.pathname}` |
Create a folder to store the databases :
mkdir -p /usr/share/GeoIP
Download Country IP database
wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz
gunzip GeoIP.dat.gz
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
| if [ -f ~/.bash_docker_compose ]; then | |
| . ~/.bash_docker_compose | |
| fi |