$downloader = new \Jrdev\SatisPressDownloader('https://domain.tld/satispress/packages.json', [
// 'auth' => ['user', 'pass'], // Basic auth, if required.
// 'baseDir' => __DIR__, // Base directory to create the sub-directories `cache` and `packages`.
// 'versions' => 1, // How many versions of each package should be downloaded: 1 = the latest, 2 = the two latest versions, etc.
]);
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
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer \ | |
&& chmod +x /usr/local/bin/composer |
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
<?php | |
function get_server_memory_usage() { | |
$free = shell_exec('free'); | |
$free = (string)trim($free); | |
$free_arr = explode("\n", $free); | |
$mem = explode(" ", $free_arr[1]); | |
$mem = array_filter($mem); | |
$mem = array_merge($mem); |
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
RewriteEngine On | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteRule ^(.+)-[0-9]+\.(js|css)$ $1.$2 [L] |
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
zend_extension=xdebug.so | |
xdebug.remote_enable = on | |
xdebug.remote_connect_back = on | |
xdebug.idekey = "vagrant" | |
xdebug.default_enable = 1 | |
xdebug.remote_autostart = 0 | |
xdebug.remote_port = 9000 | |
xdebug.remote_handler=dbgp | |
xdebug.remote_log="/var/log/xdebug/xdebug.log" | |
xdebug.remote_host=10.0.2.2 |
So basically FlowType doesn't know about CSS Modules, a really handy way of dealing with the plagues of CSS in codebases (global variables and dependency wackiness mainly).
What WebPack allows us to do is "require" CSS files and use their class names:
import styles from "my_styles.css";
import React from "react";
Adding favicon to header:
add_action('wp_head', function () {
printf('<link rel="shortcut icon" type="image/x-icon" href="/favicon.ico">');
});
Do logging programmatically
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
{ | |
"cmd": ["php", "-l", "$file"], | |
"file_regex": "^.* in (...*?) on line ([0-9]*)", | |
"selector": "source.php" | |
} |