Need to setup gpg-agent first, on OSX I use keychain (it also does ssh-agent)
$ brew info keychain
keychain: stable 2.8.5
User-friendly front-end to ssh-agent(1)
https://www.funtoo.org/Keychain
/usr/local/Cellar/keychain/2.8.5 (7 files, 108.5KB) *
@echo off | |
wsl exit | |
powershell -Command "Set-NetAdapterLso -Name 'vEthernet (WSL)' -IPv4Enabled $False -IPv6Enabled $False" |
<?php | |
/** | |
* By default, cURL sends the "Expect" header all the time which severely impacts | |
* performance. Instead, we'll send it if the body is larger than 1 mb like | |
* Guzzle does. | |
*/ | |
function add_expect_header(array $arguments) | |
{ | |
$arguments['headers']['expect'] = ''; |
#!/bin/bash | |
brew search librabbitmq | |
brew install rabbitmq-c | |
pecl install amqp | |
# set the path to librabbitmq install prefix [autodetect] : /usr/local/Cellar/rabbitmq-c/0.10.0 | |
# if it fails follow the following (reference: https://github.com/pdezwart/php-amqp/issues/355#issuecomment-563203121): |
body { | |
text-align: justify; | |
} | |
code, pre { | |
font-family: "Hack", monospace; | |
} | |
h1, h2, h3, h4, h5, h6 { | |
text-align: left; |
One-liner for finding non-ASCII characters
# Linux
$ grep --color='auto' -P -n "[\x80-\xFF]" file.js
# Mac OS X after 'brew install pcre'
$ pcregrep --color='auto' -n "[\x80-\xFF]" file.js
This is a simple way to install mailhog, might not be the best solution for everyone, you can look for repositories, still have to register the binary in the PATH, among other things, this is a manual simple install.
Download mailhog from the releases page on github: https://github.com/mailhog/MailHog/releases
Save the binary at /opt/mailhog/mailhog
Give it executable permission chmod +x /opt/mailhog/mailhog
Download the gist: https://gist.github.com/renatomefi/d133fea9cb5a7b00f91edb24b83d9a31#file-init-d-mailhog-sh
Put it at /etc/init.d/mailhog
FROM alpine:3.3 | |
MAINTAINER Tom Maiaroto <tom@outdoorsy.co> | |
# Install packages | |
RUN apk --update --repository http://dl-3.alpinelinux.org/alpine/edge/main add \ | |
freetype-dev \ | |
libjpeg-turbo-dev \ | |
libpng-dev \ | |
libwebp-dev \ | |
php7 \ |
<?php | |
/** | |
* gets the current post type in the WordPress Admin | |
*/ | |
function get_current_post_type() { | |
global $post, $typenow, $current_screen; | |
//we have a post so we can just get the post type from that | |
if ( $post && $post->post_type ) { | |
return $post->post_type; |