Awesome PHP has been relocated permanently to its own Github repository. No further updates will made to this gist.
Please open an issue for any new suggestions.
<# | |
Note: Eliminate `-WhatIf` parameter to get action be actually done | |
Note: PS with version prior to 4.0 can't delete non-empty folders | |
#> | |
Get-ChildItem -Path "." -Include "node_modules" -Recurse -Directory | Remove-Item -Recurse -Force -WhatIf |
<?php | |
class ForLoop implements IteratorAggregate | |
{ | |
public $from = 0, $to, $step = 1; | |
function getIterator() { | |
for($i = $this->from; $i <= $this->to; $i += $this->step) { | |
yield $i; |
<?php | |
/** | |
* Plugin Name: MLP Autosync Terms | |
* Description: Automatically sync all linked terms when a post is saved | |
* Author: Biont | |
* Author URI: https://github.com/Biont | |
* License: GPLv3 | |
*/ | |
/** |
<?php | |
use Rarst\Profiler\Handler; | |
global $wp; | |
if ( Handler::$profiling && empty( $wp ) ) { | |
Handler::close(); | |
} |
<?php | |
namespace igorw\lusp; | |
// all functions return a pair of [val, env] | |
function evaluate($expr, $env = []) { | |
if (is_string($expr)) { | |
if (is_numeric($expr)) { | |
$val = (float) $expr; |
#!/bin/bash | |
# | |
# This script configures WordPress file permissions based on recommendations | |
# from http://codex.wordpress.org/Hardening_WordPress#File_permissions | |
# | |
# Author: Michael Conigliaro <mike [at] conigliaro [dot] org> | |
# | |
WP_OWNER=www-data # <-- wordpress owner | |
WP_GROUP=www-data # <-- wordpress group | |
WP_ROOT=$1 # <-- wordpress root directory |
Awesome PHP has been relocated permanently to its own Github repository. No further updates will made to this gist.
Please open an issue for any new suggestions.