Skip to content

Instantly share code, notes, and snippets.

View KingYes's full-sized avatar

Yakir Sitbon KingYes

View GitHub Profile
bjornjohansen /
Last active September 17, 2023 21:12
Run all due cron events for WordPress with WP-CLI. Works with both single sites and multisite networks.
# Copyright © 2015 Bjørn Johansen
# This work is free. You can redistribute it and/or modify it under the
# terms of the Do What The Fuck You Want To Public License, Version 2,
# as published by Sam Hocevar. See for more details.
# Check if WP-CLI is available
if ! hash wp 2>/dev/null; then
Rarst / WordPress.xml
Last active August 5, 2021 04:14
WordPress Live Templates for PhpStorm
<?xml version="1.0" encoding="UTF-8"?>
<templateSet group="WordPress">
<template name="aa" value="add_action( '$hook$', '$callback$' );&#10;$END$" description="add_action" toReformat="false" toShortenFQNames="true">
<variable name="hook" expression="" defaultValue="" alwaysStopAt="true" />
<variable name="callback" expression="" defaultValue="" alwaysStopAt="true" />
<option name="HTML_TEXT" value="false" />
<option name="HTML" value="false" />
<option name="XSL_TEXT" value="false" />
<option name="XML" value="false" />
KingYes /
Created November 26, 2013 14:41
Encode audio files (VBR Profile) and preserve id3 tags used with `lame` program.
# -*- coding: utf-8 -*-
Encode audio files (VBR Profile) and preserve id3 tags
used with `lame` program.
@Author: Yakir Sitbon <>
@Version: 1.0
import os
KingYes / omer-count.php
Created April 9, 2013 12:12
Very PHP Simple method for counting of the Omer.
* Very Simple method for Omer count.
* @return bool|int Omer count or false if out Omer range date.
* @author Yakir Sitbon (
function yakir_get_omer_count() {
// Get now jd date.
Rarst / backtrace-error-handler.php
Created October 4, 2012 19:31
Error handler with WordPress backtrace in message.
set_error_handler( 'backtrace_error_handler', error_reporting() );
function backtrace_error_handler( $errno, $errstr, $errfile, $errline, $errcontext ) {
// handle @
if( 0 === error_reporting() )
return false;
Rarst /
Last active February 21, 2023 11:21
WordPress coding standards configuration for PhpStorm

Now Native

PhpStorm now bundles WordPress coding style natively, starting from version 8.

  1. Go to Project Settings > Code Style > PHP.
  2. Select Set From... (top right of window) > Predefined Style > WordPress.

No longer need to muck with this import! :)