View PHPstorm-live-template.php
/**
* 1. Goto Preferences -> Editor -> Live Template -> PHP
* 2. Klick in the right +
* 3. chose Live Template
* 4. Give a abbreviation like "pdebug"
* 5. Copie the Template into Template Text
* 6. in your code Type "pdeb.." use auto compleate ;)
*
* You get a Debug like this.
*
View .bashrc
[ -r /etc/bashrc ] && source /etc/bashrc
[ -r /etc/bash_completion ] && source /etc/bash_completion
[ -r ~/.git-completion.bash ] && source ~/.git-completion.bash
[ -r ~/.git-prompt.sh ] && source ~/.git-prompt.sh
[ -r /usr/local/rvm/scripts/rvm ] && source /usr/local/rvm/scripts/rvm
__has_parent_dir () {
# Utility function so we can test for things like .git/.hg without firing up a
# separate process
test -d "$1" && return 0;
View functions.php
<?php
/**
* Uku functions and definitions
*
* Change note:
* @see line 31 - 40 remove register nav_menu, this is merge into inc/nav-menu.php
* @see line 987 - 990 require nav-menu.php
*
* @package Uku
* @since Uku 1.0
View load_plugin_assets.php
<?php
/**
* Load template or assets
*
* @param $tpl
* @param $type
*/
function load_plugin_assets( $tpl, $type = 'php' ){
$default_tpl = $tpl . '.’ . $type;
View AdminMenu.php
<?php # -*- coding: utf-8 -*-
namespace my_plugin\admin_menu;
use my_plugin\functions as Functions;
/**
* Abstract AdminMenu class
*
* Provides methods to create admin menues
View .htaccess
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
# add a trailing slash to /wp-admin
RewriteRule ^(?:([_0-9a-zA-Z-]+)/?){0,2}wp-admin$ $1/wp-admin/ [R=302,L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
View gist:fa9b586f9af602e88ed6ec29fc15611d
<?php # -*- coding: utf-8 -*-
namespace [PLUGIN]\Addons;
class Loader {
/**
* @var array
*/
const ADDONSPATH = '/../Addons/';
View wp-flush-rules.php
<?php
/**
* validate the last modification of this file
* on modification flush rewrite rules
*
* @return void
*/
function _flush_rules() {
$o = __CLASS__;
View wp-logger.php
<?php
add_filter( 'logfile_path', function(){ return __DIR__ . '/log/'; } );
add_filter( 'logfile_name', function(){ return 'app.log'; } );
wp_logger( __LINE__, 'Log msg' );
/**
* log easy a msg
*
* @param int $line the linenumer
View show-colors.sh
#/bin/sh
# Show all the colours of the rainbow, should be run under bash
for STYLE in 0 1 2 3 4 5 6 7; do
for FG in 30 31 32 33 34 35 36 37; do
for BG in 40 41 42 43 44 45 46 47; do
CTRL="\033[${STYLE};${FG};${BG}m"
echo -en "${CTRL}"
echo -n "${STYLE};${FG};${BG}"
echo -en "\033[0m"
done