This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.
To capture the video (filesize: 19MB), using the free "QuickTime Player" application:
<?php | |
/** | |
* This code is intended to be added to your wp-config.php file just below the top comment block. | |
* It should replace the existing define('DB_*') statements. You can add or remove sections | |
* depending on the number of environments you intend to setup. You should change all values of | |
* DB_NAME, DB_USER, DB_PASSWORD, and DB_HOST for each environment, making them all distinct | |
* for security purposes. | |
*/ | |
// determine the current environment |
<?php | |
/** | |
* Image shortcode callback | |
* | |
* Enables the [kovshenin_image] shortcode, pseudo-TimThumb but creates resized and cropped image files | |
* from existing media library entries. Usage: | |
* [kovshenin_image src="http://example.org/wp-content/uploads/2012/03/image.png" width="100" height="100"] | |
* | |
* @uses image_make_intermediate_size | |
*/ |
<?php | |
add_action( 'loop_start', 'mark_posts_with_query' ); | |
function mark_posts_with_query( $query ) { | |
$in_main_query = $query->is_main_query(); | |
foreach ( $query->posts as $post ) { | |
Let's say you start a project locally, and do some editing.
$ mkdir -p ~/git/foo && cd ~/git/foo
$ touch NEWFILE
Now you decide you want to create a new github repo and track it, but the directory is non-empty so git won't let you clone into it. You can fix this, thusly:
{ | |
"name" : "rarst/install-test", | |
"description" : "Test project for WordPress stack via Composer", | |
"authors" : [ | |
{ | |
"name" : "Andrey Savchenko", | |
"homepage": "http://www.Rarst.net/" | |
} | |
], | |
"type" : "project", |
<?php | |
add_theme_support( 'html5', array( 'search-form', 'comment-form', 'comment-list', 'gallery', 'caption' ) ); |
#!/usr/bin/env bash | |
dir="." | |
if [ $1 ]; then dir=$1; fi | |
bad_funcs="exec system passthru shell_exec escapeshellarg escapeshellcmd proc_close proc_open dl popen show_source ini_set" | |
for func in $bad_funcs | |
do | |
grep -R --include=*.php $func $dir | |
done |
<?xml version="1.0" encoding="UTF-8"?> | |
<templateSet group="WordPress"> | |
<template name="aa" value="add_action( '$hook$', '$callback$' ); $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" /> |