A reference for setting up Linux/Ubuntu server for LAMP, Node.js laboratory.
May be helpful for others, hence this git. If it contains errors, please push them.
This assumes
<?php | |
/** | |
* Prevents the creation of full Administrators by client accounts | |
* Forked from JPB_User_Caps (unable to locate origin) | |
* | |
* @return void | |
* @author Jonathan Christopher | |
*/ | |
if( is_admin() ) |
<?php | |
// https://code.google.com/p/wami-recorder/ | |
# Save the audio to a URL-accessible directory for playback. | |
parse_str($_SERVER['QUERY_STRING'], $params); | |
$name = isset($params['name']) ? $params['name'] : 'output.wav'; | |
$content = file_get_contents('php://input'); | |
$fh = fopen($name, 'w') or die("can't open file"); | |
fwrite($fh, $content); | |
fclose($fh); |
<?php | |
add_action( 'ms_model_event', 'my_event_handler', 10, 2 ); | |
/** | |
* Handles an event and process the correct communication if required. | |
* | |
* @param MS_Model_Event $event The event that is processed. | |
* @param mixed $data The data passed to the event handler. | |
*/ |
#!/bin/bash | |
# For this script to work, save it somewhere in the executable path, like /usr/local/sbin/backup.sh | |
# make it executable: chmod +x /usr/local/sbin/backup.sh | |
# then add it to cron: crontab -e | |
# and add the line below, which will run backup 3am each day, then upload to Dropbox | |
# 0 3 * * * /usr/local/sbin/backup.sh > /dev/null 2>&1 | |
# You also need WP CLI installed: http://wp-cli.org/ | |
<?php | |
/* | |
Plugin Name: Disable plugins when doing local dev | |
Description: If the WP_LOCAL_DEV constant is true, disables plugins that you specify | |
Version: 0.1 | |
License: GPL version 2 or any later version | |
Author: Mark Jaquith | |
Author URI: http://coveredwebservices.com/ | |
*/ |
package main | |
import ( | |
"fmt" | |
"log" | |
"os/exec" | |
"runtime" | |
) | |
type Worker struct { |
Make sure these boxes are checked before submitting/approving the PR
<?php | |
/* | |
* dl-file.php | |
* | |
* Protect uploaded files with login. | |
* | |
* @link http://wordpress.stackexchange.com/questions/37144/protect-wordpress-uploads-if-user-is-not-logged-in | |
* | |
* @author hakre <http://hakre.wordpress.com/> | |
* @license GPL-3.0+ |