Skip to content

Instantly share code, notes, and snippets.

# Install dependencies
#
# * checkinstall: package the .deb
# * libpcre3, libpcre3-dev: required for HTTP rewrite module
# * zlib1g zlib1g-dbg zlib1g-dev: required for HTTP gzip module
apt-get install checkinstall libpcre3 libpcre3-dev zlib1g zlib1g-dbg zlib1g-dev && \
mkdir -p ~/sources/ && \
# Compile against OpenSSL to enable NPN
@tollmanz
tollmanz / gist.css
Created June 3, 2012 19:16
Add Cacheable Gists to Your WordPress Site
.gist {
color: #e4322e;
}
.gistdiv {
padding: 0;
margin: 0;
}
.gist .gist-file {
@tollmanz
tollmanz / gist:2641305
Created May 9, 2012 02:25
wp_list_pluck Example
<?php
// Take from posts-to-posts (http://scribu.net/wordpress/posts-to-posts)
public function get_related( $post_id, $extra_qv = array() ) {
$post_id = (array) $post_id;
$connected = $this->get_connected( $post_id, $extra_qv );
if ( !$connected )
return false;
if ( !$connected->have_posts() )
@tollmanz
tollmanz / good-asciinema.md
Last active March 26, 2018 16:23
Create an uniformly typed SVG of a terminal recording using asciinema and svg-term-cli
  1. Install asciinema

  2. Record a command line interaction

    asciinema rec /path/to/asciinema-file
    
  3. When prompted, save locally with ctrl-c

  4. Optionally, view the video

@tollmanz
tollmanz / devicepx-jetpack.js
Created November 7, 2013 18:45
Full version of the minified devicepx-jetpack.js
(function (root, ns, factory) {
"use strict";
if (typeof(module) !== 'undefined' && module.exports) {
module.exports = factory(ns, root);
} else if (typeof(define) === 'function' && define.amd) {
define("factory", function () {
return factory(ns, root);
});
} else {
root[ns] = factory(ns, root);

Keybase proof

I hereby claim:

  • I am tollmanz on github.
  • I am tollmanz (https://keybase.io/tollmanz) on keybase.
  • I have a public key ASCPtviWTYmbIqYLkyA4LmBf-AGpAbrJWVFWHOl-BCuWPAo

To claim this, I am signing this object:

@tollmanz
tollmanz / gist:2708698
Created May 16, 2012 08:28
Caching with a "Backup"
<?php
function get_hottest_cities( $force = false ) {
$hottest_cities = get_transient( 'zdt-hottest-cities' );
if ( false === $hottest_cities || $force ) {
if ( $force ) {
$hottest_cities = retrieve_hottest_cities();
if ( $hottest_cities ) {
set_transient( 'zdt-hottest-cities', $hottest_cities );
mkdir ~/sources/
cd ~/sources
wget http://www.openssl.org/source/openssl-1.0.1g.tar.gz
tar -xzvf openssl-1.0.1g.tar.gz
cd ~/sources/
wget http://nginx.org/download/nginx-1.5.12.tar.gz
tar zxf nginx-1.5.12.tar.gz
cd nginx-1.5.12
@tollmanz
tollmanz / responsive.diff
Created November 18, 2013 03:22
Cleanup of responsive component
diff --git src/wp-admin/css/color-schemes/_admin.scss src/wp-admin/css/color-schemes/_admin.scss
index f7a4bc2..0a467a4 100644
--- src/wp-admin/css/color-schemes/_admin.scss
+++ src/wp-admin/css/color-schemes/_admin.scss
@@ -366,11 +366,11 @@ ul#adminmenu > li.current > a.current:after {
/* Responsive Component */
-div#moby6-toggle a:before {
+div#responsive-toggle a:before {
@tollmanz
tollmanz / responsive.diff
Last active December 28, 2015 04:29
Initial (and fairly rough) merge of responsive component
Index: src/wp-admin/admin-header.php
===================================================================
--- src/wp-admin/admin-header.php (revision 26132)
+++ src/wp-admin/admin-header.php (working copy)
@@ -67,6 +67,7 @@
decimalPoint = '<?php echo addslashes( $wp_locale->number_format['decimal_point'] ); ?>',
isRtl = <?php echo (int) is_rtl(); ?>;
</script>
+<meta name="viewport" content="width=device-width,user-scalable=no,initial-scale=1.0,maximum-scale=1.0">
<?php