The trick is to only register the listener for events that indicate failure, namely
- PROCESS_STATE_STOPPED
- PROCESS_STATE_EXITED
- PROCESS_STATE_FATAL
Once they do, we should send a SIGQUIT
to Supervisor.
/** | |
* Run this with `babel-node generateSVG.js` | |
*/ | |
import fs from 'fs'; | |
import path from 'path'; | |
import { Readable } from 'stream'; | |
import childProcess from 'child_process'; | |
import phantomjs from 'phantomjs'; | |
import im from 'imagemagick'; | |
import tmp from 'tmp'; |
In order for Livereload to work, you need a Firefox or Chrome extension as Gulp doesn't inset it automatically. Alternatively, you can also manually put the livereload script in footer.php
, just make sure to insert it only on development environment:
<script>document.write('<script src="http://' + (location.host || 'localhost').split(':')[0] + ':35729/livereload.js?snipver=1"></' + 'script>')</script>
Title pretty much sums it up. I wanted it to support drag and drop as well, which is why the .droparea
is positioned absolutely; It's below the input field and the field itself gets its opacity set to 0, for better UX experience.
#!/usr/bin/env bash | |
# Messaging script for pushover.net (make sure you have an account) | |
# put this somewhere in your $PATH and make it executable | |
if [ $# -eq 0 ]; then | |
echo "Usage: pushover <title> <message>" | |
echo "Example: $ pushover \"This is the title\" \"This is a nice message\"" | |
exit | |
fi |
import superagent from 'superagent'; | |
import merge from 'lodash/merge'; | |
import { camelizeKeys, decamelizeKeys } from 'humps'; | |
import config from 'config'; | |
const CALL_API = Symbol.for('Call API'); | |
/** | |
* Prepare headers for each request and include the token for authentication. | |
* @param {Boolean} token Authentication token |
import fs from 'fs'; | |
import path, { resolve } from 'path'; | |
import assert from 'assert'; | |
import Module from 'module'; | |
import jsdom from 'jsdom'; | |
import Mocha from 'mocha'; | |
import chokidar from 'chokidar'; | |
import { isMatch } from 'micromatch'; | |
import log from 'fancy-log'; | |
import async from 'async'; |
check process hhvm with pidfile /var/run/hhvm/pid | |
group hhvm | |
start program = "/usr/sbin/service hhvm start" with timeout 60 seconds | |
stop program = "/usr/sbin/service hhvm stop" | |
if failed unixsocket /var/run/hhvm/hhvm.sock then restart | |
if mem > 400.0 MB for 1 cycles then restart | |
if 5 restarts with 5 cycles then timeout |
This is a simplified showcase of how you can easily build your own Optin form in WordPress.
It can connect to any API that supports cURL (most of them do). There is no error reporting implemented. It uses exit intent detection script called Ouibounce, which needs to be enqueued in your functions.php
See the tutorial here: How to build your own WordPress email form
<?php | |
// Published under GPL | |
// tutorial here: https://codeable.io/community/how-to-import-json-into-wordpress/ | |
class Developer_Import { | |
public function __construct() { | |
add_action( 'wp_ajax_import_developer', array( $this, 'import_developer' ) ); |