Skip to content

Instantly share code, notes, and snippets.

View swissspidy's full-sized avatar

Pascal Birchler swissspidy

View GitHub Profile
@thefuxia
thefuxia / class.View_All_Posts.php
Created June 24, 2010 20:42
Adds a view all posts page to any archive.
<?php
/**
* Adds a view all posts page to any archive.
*
* @author Thomas Scholz http://toscho.de
* @version 1.1
* @license: GPL2
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
anonymous
anonymous / gist:666394
Created November 7, 2010 20:23
<!-- http://benalman.com/projects/jquery-urlinternal-plugin/ -->
<script src='<?php bloginfo('template_directory'); ?>/js/jquery.ba-urlinternal.min.js'></script>
<!-- http://www.asual.com/jquery/address/ -->
<script src='<?php bloginfo('template_directory'); ?>/js/jquery.address-1.3.min.js'></script>
<script>
// Original JavaScript by Chris Coyier
// Updated October 2010 by Stewart Heckenberg & Chris Coyier
@ericallam
ericallam / gist:1019446
Created June 10, 2011 18:35
How to log all queries for a PostgreSQL homebrew install on OS X

Open the postgresql.conf config file:

$> mate /usr/local/var/postgres/postgresql.conf

Uncomment the line with 'log_destination' and set it to 'syslog'

log_destination = 'syslog'

Open the syslog config:

@scribu
scribu / restrict-comment-editing.php
Created June 28, 2011 22:24
Restrict comment editing
<?php
// http://scribu.net/wordpress/prevent-blog-authors-from-editing-comments.html
function restrict_comment_editing( $caps, $cap, $user_id, $args ) {
if ( 'edit_comment' == $cap ) {
$comment = get_comment( $args[0] );
if ( $comment->user_id != $user_id )
$caps[] = 'moderate_comments';
}
@markjaquith
markjaquith / disable-comments-query.php
Created July 25, 2011 16:08
Disable comments query plugin
<?php
/*
Plugin Name: Disable Comment Querying
Description: Disables comment queries
Version: 0.1
License: GPL version 2 or any later version
Author: Mark Jaquith
Author URI: http://coveredwebservices.com/
*/
@acdha
acdha / curl-ttfb.sh
Created November 28, 2011 23:03
Use curl to measure and report HTTP response times (pre-, start- and total transfer)
#!/bin/bash
#
# Report time to first byte for the provided URL using a cache buster to ensure
# that we're measuring full cold-cache performance
while (($#)); do
echo $1
curl -so /dev/null -H "Pragma: no-cache" -H "Cache-Control: no-cache" \
-w "%{http_code}\tPre-Transfer: %{time_pretransfer}\tStart Transfer: %{time_starttransfer}\tTotal: %{time_total}\tSize: %{size_download}\n" \
"$1?`date +%s`"
@helen
helen / repeatable-fields-metabox.php
Created January 11, 2012 04:42
Repeating Custom Fields in a Metabox
<?
/**
* Repeatable Custom Fields in a Metabox
* Author: Helen Hou-Sandi
*
* From a bespoke system, so currently not modular - will fix soon
* Note that this particular metadata is saved as one multidimensional array (serialized)
*/
function hhs_get_sample_options() {
@rmccue
rmccue / plugin-file.php
Created January 17, 2012 12:27 — forked from kovshenin/plugin-file.php
Improved class concept
<?php
/*****
All new versions will be posted at
https://github.com/rmccue/Rotor_WPPlugin
Please use that repository instead of this Gist.
******/
@bueltge
bueltge / remove_br_in_pre.php
Created January 23, 2012 15:03
Code to Question on WPSE questions 39843
<?php
/**
* Plugin Name: Remove br in pre
* Plugin URI: http://wordpress.stackexchange.com/questions/39843/no-filter-of-code-on-switch-from-html-to-visual-editor-how
* Text Domain:
* Domain Path: /languages
* Description:
* Version: beta
* Author: Frank Bültge
* Author URI: http://bueltge.de
@Rarst
Rarst / r-debug.php
Last active February 3, 2024 17:30
R Debug (set of dump helpers for debug)
<?php
/*
Plugin Name: R Debug
Description: Set of dump helpers for debug.
Author: Andrey "Rarst" Savchenko
Author URI: https://www.rarst.net/
License: MIT
*/