- CSS3 — what’s new
- HTML5 — ditto
- Macaw
- SVG — animation, sprites
- JavaScript
- Ember, Angular
- BrowserSync
Author: Mike
(e.g. WordPress site)
Tar Gz Directory
- Go to /var/www
- tar -zcf ../mysite_today.tar.gz public_html
- (-z compress; c create file; f archive file name)
- contains public_html in archive.
- Download with WinSCP
MySQL
mysqldump -u username -p dbname | gzip > myexport.sql.gz
Type your password. Done.
Windows Keyboard Layout Shortcut
I accidentally swap to a European keyboard layout. A lot.
[code]Left Alt + Shift[/code]
MD5/Sha1 File Checksums on Windows
- Get this tool from Microsoft
- cmd: fciv.exe –add my_file.txt -sha1 (omit -sha1 for md5 default)
WordPress Break Point
Via Ryan McCue.
[php title="functions.php"]
register_shutdown_function(function () {
var_dump($GLOBALS['wp_current_filter']);
});[/php]
Exit Gulp Command
If your gulp.js has a “watch” it’ll continue running to monitor changed files.
To exit back to the command prompt press Ctrl+C
In addition to cloning from Git and installing via Composer Laravel can now be installed via a PHAR file.
The documentation is currently a little Linux centric.
On Windows download the laravel.phar file, open a command prompt in its location and run:
[code]
php laravel.phar new my-project-name
[/code]
That will create a new directory called my-project-name and install Laravel in there. This is a lot faster than installing via composer.
PHP’s Memory Caching Blackspot
PHP 5.4 came with APC (Alternative PHP Caching) which acted as both a byte-code cache (reducing the work of compiling the PHP files at runtime) and an in-memory object cache allowing the PHP app to store and retrieve arbitrary data.
PHP 5.5 is moving to Zend’s OpCache (bundled, but not enabled by default) which will replace APC’s function as a byte code cache. The gotcha is that OpCache does not (yet?) provide object caching that your app can use to store its own data.
So if you’re moving to PHP 5.5 you may find a bit of a black spot when it comes to an automatically included memory cache. APCu looks to provide the object caching of APC, but it does require extra installation.
Quickly Protect Whole WordPress Site
Some WordPress sites aren’t for public consumption.
Chuck this in your functions.php
add_action('init', function() {
$uri = $_SERVER['REQUEST_URI'];
if(!preg_match('/wp\-(admin|login)/', $uri) AND !is_user_logged_in()) {
header("Location:" . get_bloginfo('url').'/wp-admin/');
exit;
}
});
The handy window.matchMedia JavaScript method lets you test a media query against the current viewport.
I made a little tool to test a batch of media queries at once. It simply iterates an array and reports success/failure.
Note that results won’t be accurate when a vendor prefixed media query is unsupported.