Skip to content

Instantly share code, notes, and snippets.

Avatar
🌊
Surfing the open source wave

Dominik Schilling ocean90

🌊
Surfing the open source wave
View GitHub Profile
View shortcode-cache.php
<?php
add_action( 'init', function () {
global $shortcode_tags;
foreach ( $shortcode_tags as $tag => $function ) {
$shortcode_tags[$tag] = function ( $attr, $content = null ) use ( $tag, $function ) {
$expires = 60;
$expires = apply_filters( 'shortcode_cache_expires', $expires, $tag );
$cache_key = $tag . md5( serialize( $attr ) ) . get_the_ID();
$cached = wp_cache_get( $cache_key );
@chriseppstein
chriseppstein / _minified_filenaming.md
Last active Nov 26, 2019
compiling a minified version of css. This configures your compass project to emit files in minified form when compiling for production.
View _minified_filenaming.md
$ compass compile --environment production && compass compile

Afterwards you will have both the minified and non-minified versions in your output folder. Note that compass clean will not clean up your minified files.

@nacin
nacin / london-contribute.md
Created Nov 24, 2013
WordCamp London 2013 Contributor Day Notes from the introduction to contributing to core.
View london-contribute.md
@Shelob9
Shelob9 / good-bug-report.txt
Created Nov 17, 2013
What makes a good WordPress bug report. From 2013 WordCamp Orlando contributor sessions with Andrew Nacin and Mark Jaquith.
View good-bug-report.txt
What makes a good bug report:
* Steps to reproduce, with earliest step Shouldn’t need to know code
* Description of the bug. What you saw vs what you expected.
* Error messages or error codes.
*
* PHP errors-
*
@markjaquith
markjaquith / gist:7029068
Created Oct 17, 2013
How to get git-svn working in OS X Mavericks with Homebrew
View gist:7029068
sudo xcodebuild -license
xcode-select --install # There will be a GUI prompt
sudo cpan SVN::Core # use the "sudo" method when prompted
# Then add this to your ~/.profile:
# export PATH=/Library/Developer/CommandLineTools/usr/bin:$PATH
# Then probably:
brew reinstall git
brew reinstall subversion
@jerolimov
jerolimov / git-afterwards
Last active Dec 19, 2015
Initialize a git repository afterwards with separate commits based on the file modified timestamp. Simple run git init && git afterwards
View git-afterwards
#!/bin/bash
IFS=$(echo -en "\n\b")
# Ensure we are in a git repo with gitignore.
if [ ! -d .git ]; then echo "Current working directory is not a git repository."; exit -1; fi
#if [ ! -f .gitignore ]; then echo "Current working directory has no .gitignore file."; exit -2; fi
# Sort (by date) and save new files
for file in `git status --porcelain --untracked-files=all | grep -v '.log$' | grep '^?? ' | sed 's/^?? //g'`
do
@jerolimov
jerolimov / $CUSTOMERNAME-log
Last active Dec 18, 2015
This script shows a grouped (by date), ordered commit list of multiple git repositories.
View $CUSTOMERNAME-log
#!/bin/bash
allgits=`find ~/.cocoapods/CUSTOMERNAME ~/git/CUSTOMERNAME -name .git | sed 's_/.git__'`
filter=$*
filter="$filter --author=jerolimov"
filter="$filter --date=iso"
filter="$filter --after=2013-05-01"
filter="$filter --before=2013-05-31"
for i in $allgits
@nacin
nacin / trac-attach.sh
Last active Mar 21, 2016
A script that leverages Trac XML-RPC (I know, I know) to upload patches. Usage: `trac-attach.sh 12345`
View trac-attach.sh
#!/bin/sh
# A script that leverages Trac XML-RPC (I know, I know) to upload patches.
#
# This script is written specifically for the Mac, in that it reads from
# your keychain to derive your SVN password. You can change the SVN_PASS
# line below if you wanted to pull from ~/.svn/ or what not.
#
# Basic usage: `trac-attach.sh 12345` uploads a patch to ticket #12345,
# using the name 12345.diff. If there exists a 12345.diff, the patch is
@markjaquith
markjaquith / gist:4219135
Last active Oct 13, 2015
Script for applying WordPress patches. Provide an ID (prompts you to select patch), a Trac patch URL, or a raw Trac patch URL
View gist:4219135
#!/usr/bin/ruby
#
# The MIT License (MIT)
# Copyright (c) 2013 Mark Jaquith
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
View t5-query-log.php
<?php
/**
* Plugin Name: T5 Log Queries
* Description: Writes all queries to '/query-log.sql'.
* Plugin URI: http://wordpress.stackexchange.com/a/70853/73
* Version: 2012.11.04
* Author: Thomas Scholz
* Author URI: http://toscho.de
* Licence: MIT
*/