メールの振り分けをしてくれるソフトウェア。
設定ファイルにルールを記載するとよきに計らってくれる。
yum install procmail
# procmailのパス調べる
which procmail
// !! this gist was created in 2015, it doesn't work on most modern distributions !! | |
// e.g: get_ip("eth0"); | |
function get_ip($interface) { | |
$interface = escapeshellarg($interface); | |
$pattern = "/inet addr:(\d+\.\d+\.\d+\.\d+)/"; | |
$text = shell_exec("ifconfig $interface"); | |
preg_match($pattern, $text, $matches); | |
return $matches[1]; | |
} |
const delay = ms => new Promise(resolve => setTimeout(resolve, ms)); | |
async function something() { | |
console.log("this might take some time...."); | |
await delay(5000); | |
console.log("done!") | |
} | |
something(); |
<?php | |
namespace App\Http\Controllers; | |
use App\Result; | |
use Illuminate\Http\Request; | |
use Symfony\Component\HttpFoundation\StreamedResponse; | |
class ExportController extends Controller | |
{ |
function my_remove_wp_seo_meta_box() { | |
remove_meta_box('wpseo_meta', YOUR_POST_TYPE_NAME_HERE, 'normal'); | |
} | |
add_action('add_meta_boxes', 'my_remove_wp_seo_meta_box', 100); |
#!/bin/bash | |
# This one-liner script plays a video in an infinite loop on a raspberry pi | |
# for a video-art exhibition. | |
# It was written for a video in portrait orientation so the video is rotated 270 | |
# to use up the whole screen (which was also rotated). | |
# Charles Martin, July 2016 | |
omxplayer -o local --loop /home/pi/video.mp4 --orientation 270 |
// 使用 userAgent 判断是否微信内置浏览器 | |
if( navigator.userAgent.toLowerCase().indexOf('micromessenger') > -1 || typeof navgator.wxuserAgent !== "undefined" ) { | |
return true; | |
} |
#!/bin/bash | |
mkdir wordpress-site && cd wordpress-site | |
touch docker-compose.yml | |
cat > docker-compose.yml <<EOL | |
version: "2" | |
services: | |
my-wpdb: |
#!/bin/bash | |
cd wordpress-site | |
cat >> docker-compose.yml <<EOL | |
my-wpcli: | |
image: tatemz/wp-cli | |
volumes_from: | |
- my-wp | |
links: |
<?php //* Mind this opening PHP tag | |
// Remove the logout link in comment form | |
add_filter( 'comment_form_logged_in', '__return_empty_string' ); |