Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View Rarst's full-sized avatar
Otherwise occupied.

Andrey Savchenko Rarst

Otherwise occupied.
View GitHub Profile
@Rarst
Rarst / readme.md
Last active August 29, 2015 14:02
Can I use code with license X in project with license Y ? http://www.rarst.net/code/license-compatibility/
<?php
if ( did_action( 'muplugins_loaded' ) || ! isset( $_GET['time_plugins_load'] ) ) {
return;
}
Time_Plugins_Load::load();
/**
* Hijacks plugins load process and captures timing information.
body {
overflow: hidden;
font-family: "Helvetica Neue", Helvetica, "Segoe UI", Arial, freesans, sans-serif;
font-size: 16px;
line-height: 1.6;
word-wrap: break-word
}
body > *:first-child {
margin-top: 0 !important
@Rarst
Rarst / wordpress.less
Created April 26, 2012 20:04
WordPress colors vars in LESS
// Logo
// http://wordpress.org/about/logos/
@wp_logo_blue: #21759B;
@wp_logo_orange: #D54E21;
@wp_logo_grey: #464646;
// Admin
// http://dotorgstyleguide.wordpress.com/outline/colors/
@Rarst
Rarst / class-oh-shuddup.php
Created June 14, 2012 17:35
Shuts up deprecated messages for specific functions
<?php
Oh_Shuddup::on_load( array( 'get_theme_data' ) );
/**
* Shuts up deprecated messages for specific functions.
*/
class Oh_Shuddup {
static $functions;
@Rarst
Rarst / backtrace-error-handler.php
Created October 4, 2012 19:31
Error handler with WordPress backtrace in message.
<?php
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
Rarst / r-cache-scripts.php
Created February 20, 2013 19:22
Black magic, probably breaks something.
<?php
r_cache_scripts();
function r_cache_scripts() {
if ( is_admin() )
return;
global $wp_scripts;
@Rarst
Rarst / a-fresher-cache.php
Last active December 16, 2015 22:09
Additional items for A Fresher Cache WP plugin: APC, plugin/themes updates.
<?php
add_action( 'init', function () {
if ( ! function_exists( 'afc_add_item' ) || ! function_exists( 'apc_clear_cache' ) ) {
return;
}
afc_add_item( array(
'id' => 'apc',
@Rarst
Rarst / readme.md
Last active December 24, 2015 22:09
Bolt on of whoops to WordPress, rough, proper plugin some time later
@Rarst
Rarst / composer.json
Last active January 4, 2016 15:00
Converter from Facebook's locales XML to PHP array.
{
"name": "yoast/facebook-util",
"require": {
"symfony/dom-crawler": "^2.6",
"symfony/css-selector": "^2.6"
}
}