Skip to content

Instantly share code, notes, and snippets.

View ocean90's full-sized avatar
🌊
Surfing the open source wave

Dominik Schilling ocean90

🌊
Surfing the open source wave
View GitHub Profile
<?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 November 26, 2019 07:40
compiling a minified version of css. This configures your compass project to emit files in minified form when compiling for production.
$ 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 November 24, 2013 12:40
WordCamp London 2013 Contributor Day Notes from the introduction to contributing to core.
@Shelob9
Shelob9 / good-bug-report.txt
Created November 17, 2013 19:31
What makes a good WordPress bug report. From 2013 WordCamp Orlando contributor sessions with Andrew Nacin and Mark Jaquith.
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 October 17, 2013 17:37
How to get git-svn working in OS X Mavericks with Homebrew
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 December 3, 2021 20:41
Initialize a git repository afterwards with separate commits based on the file modified timestamp. Simple run git init && 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 December 18, 2015 23:29
This script shows a grouped (by date), ordered commit list of multiple git repositories.
#!/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 March 21, 2016 09:37
A script that leverages Trac XML-RPC (I know, I know) to upload patches. Usage: `trac-attach.sh 12345`
#!/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 October 13, 2015 15:48
Script for applying WordPress patches. Provide an ID (prompts you to select patch), a Trac patch URL, or a raw Trac patch URL
#!/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
@thefuxia
thefuxia / t5-query-log.php
Created November 4, 2012 13:53
T5 Log Queries
<?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
*/