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 / GPLv2.php
Last active August 25, 2024 11:31
WordPress File Templates for PhpStorm.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
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
<?php
if ( did_action( 'muplugins_loaded' ) || ! isset( $_GET['time_plugins_load'] ) ) {
return;
}
Time_Plugins_Load::load();
/**
* Hijacks plugins load process and captures timing information.
@Rarst
Rarst / WordPress.xml
Last active September 5, 2024 01:49
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" />
<context>
<option name="HTML_TEXT" value="false" />
<option name="HTML" value="false" />
<option name="XSL_TEXT" value="false" />
<option name="XML" value="false" />
@Rarst
Rarst / append.php
Last active April 27, 2016 12:31
My xhprof/uprofiler setup, tweaked for WordPress and more easily profiling segments.
<?php
use Rarst\Profiler\Handler;
global $wp;
if ( Handler::$profiling && empty( $wp ) ) {
Handler::close();
}
@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/

How to get Composer running on SiteGround shared

  1. Download getcomposer.org/composer.phar to your account's home directory — /home/username.
  2. Edit .bashrc file in same directory by adding alias composer='/usr/local/php56/bin/php-cli ~/composer.phar' line. Update php56 part to current relevant version, if necessary.
  3. Restart SSH session or run source ~/.bashrc to reload config.
  4. Use composer command!
@Rarst
Rarst / readme.md
Last active September 5, 2024 01:47
Exclude plugins and themes from update checks https://github.com/Rarst/update-blocker
@Rarst
Rarst / griddle.php
Last active August 24, 2016 20:53
Responsive grid layout backgrounds for Bootstrap.
<?php
if ( isset( $_GET['grid'] ) ) {
add_action( 'wp_print_styles', function () { ?>
<style type="text/css">
@media (min-width: 768px) {
body {
background: url("http://griddle.it/720px-12-30px") repeat-y center top !important;
}
@Rarst
Rarst / mustachepot.php
Last active September 29, 2016 13:47
MustachePOT extends MakePOT in WordPress tools to additionally scan for localized strings in Mustache templates.
<?php
error_reporting( E_ALL ^ E_STRICT ); // le sigh
require __DIR__ . '/wordpress/tools/i18n/makepot.php';
/**
* Additionally scans for localized strings in Mustache templates.
*/
class MustachePOT extends MakePOT {