Hopefully everyone has fixed this by now, however I fixed this by changing my Realtek settings from 7.1 to stereo. – VeryRedChris

I went poking around in my sound settings (Windows 10) and made the following adjustment: Sound – Playback Devices – Speakers (Realtek High Definition Audio) – Properties – Spatial Sound and set Spatial sound format to Windows Sonic for Headphones and made sure Turn on 7.1 virtual surround sound checkbox was checked. This fixed the issue! If you have Chrome open, restart it and any other existing audio apps for the changes to take affect.

Our firewall at work restricts us to only port 80 and no access to SSH – which as you can imagine for a web developer is a pretty big issue. Below I’ll describe the various methods of routing around this crap.

Create a SOCKS5 Proxy with SSH

If your firewall restricts which sites you can visit but you have access through SSH to a remote server, route your browser and other traffic through that server with a SOCKS5 proxy. This is calledDynamic Port Forwarding:

1

ssh-f-N-D1080 remote-server

The above command creates a SOCKS5 proxy server on port 1080 of your machine which sends all traffic through remote-server.

Recording a gif on OSX is fairly easy but you’ll need a few tools to make it happen – especially if you want a nice, small filesize for online viewing.

Step 1 – Record a video

You can use anything for this – I was recording a window on my screen so I used Screenium but Quicktime works fine. The output was a 15 second 1.1MB MOV file of resolution 1184×738. I saved the file as demo.mov on my desktop.

Step 2 – Convert to a Slideshow of PNGs

1

brew installffmpeg#if you don't already have it

1

mkdir output

1

ffmpeg-i demo.mov -vfscale=iw:ih -r10 output/ffout%3d.png

‘scale=iw:ih’ – Don’t change the input scale. You can also set this to specific values or ‘320:-1’ to rescale down for example

References

Say you’re pooling requests in Guzzle and want the responses to have access to data such as the request URL. Guzzle doesn’t currently allow for this but that’s all fixed with the help of a simple middleware class.

Usage

When requesting a URL with GuzzleHttp\Client, pass a RESPONSE_META array in your requests second argument like so:

Complete Example

$names=['Alpha','Beta','Charlie','Delta'];$stack= GuzzleHttp\HandlerStack::create();$stack->push(GuzzleResponseMetaMiddleware::middleware());$client=new GuzzleHttp\Client(['handler'=>$stack]);$requests=function()use($client,$names){foreach($namesas$name){$url="Http://mydomain.com/?name=".$name;yieldfunction()use($client,$url,$name){return$client->getAsync($url,['RESPONSE_META'=>['url'=>$url,'name'=>$name,],]);};}};$pool=new GuzzleHttp\Pool($client,$requests(),['concurrency'=>5,'fulfilled'=>function(Psr\Http\Message\ResponseInterface $response,$index){$url=$response->getHeaderLine('X-GUZZLE-META-url');$name=$response->getHeaderLine('X-GUZZLE-META-name');// do something with this info},]);// Initiate the transfers and create a promise$promise=$pool->promise();// Force the pool of requests to complete.$promise->wait();

Isn’t it annoying when you want to connect to your home network while out and about but don’t know what your IP is? Sick of dynamic DNS sites with arbitrary restrictions on their free tiers? Well look no further! This tutorial demonstrates how to point your home IP to a subdomain of your website using a simple PHP script.

The Concept

Set up a Route 53 subdomain for pointing to your home

A device in your home uses a scheduled task to ping a URL on your website

/**
* Find a given widget in a given sidebar and return its settings.
*
* Example usage:
* $options = [];
* try {
* $options = get_sidebar_widget_options('sidebar-1', 'recent-comments');
* } catch (Exception $e) {}
*
* @param $sidebar_id The ID of the sidebar. Defined in your register_sidebar() call
* @param $widget_type Widget type specified in register_sidebar()
* @return array Saved options
* @throws Exception "Widget not found in sidebar" or "Widget has no saved options"
*/function get_sidebar_widget_options($sidebar_id,$widget_type){// Grab the list of sidebars and their widgets$sidebars= wp_get_sidebars_widgets();// Just grab the widgets for our sidebar$widgets=$sidebars[$sidebar_id];// Get the ID of our widget in this sidebar$widget_id=0;foreach($widgetsas$widget_details){// $widget_details is of the format $widget_type-$id - we just want the id partif(preg_match("/^{$widget_type}\-(?P<id>\d+)$/",$widget_details,$matches)){$widget_id=$matches['id'];break;}}// If we didn't find the given widget in the given sidebar, throw an errorif(!$widget_id)thrownew Exception("Widget not found in sidebar");// Grab the options of each instance of our $widget_type from the DB$options= get_option('widget_'.$widget_type);// Ensure there are settings to returnif(!isset($options[$widget_id]))thrownew Exception("Widget has no saved options");// Grab the settings$widget_options=$options[$widget_id];return$widget_options;}

Drop the function in your functions.php. Note that it will find the first occurrence of your given widget in the given sidebar and return its settings.