Skip to content

Instantly share code, notes, and snippets.

@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

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 / make-info.php
Created June 24, 2014 17:50
Getting info from .org repo
<?php
function ttf_get_make_stats() {
// Make remote request to WP.org
$response = wp_remote_post(
'http://api.wordpress.org/themes/info/1.0/',
array(
'body' => array(
'action' => 'theme_information',
'request' => serialize( (object) array(
diff --git a/WordPress-Dropins/wp-stack-cdn.php b/WordPress-Dropins/wp-stack-cdn.php
index 4099276..070ace8 100644
--- a/WordPress-Dropins/wp-stack-cdn.php
+++ b/WordPress-Dropins/wp-stack-cdn.php
@@ -54,11 +54,11 @@ class WP_Stack_CDN_Plugin extends WP_Stack_Plugin {
$preg_path = preg_quote( $path, '#' );
// Targeted replace just on uploads URLs
- return preg_replace( "#=([\"'])(https?://{$domain})?$preg_path/((?:(?!\\1]).)+)\.(" . implode( '|', $this->extensions ) . ")(\?((?:(?!\\1).)+))?\\1#", '=$1http://' . $this->cdn_domain . $path . '/$3.$4$5$1', $content );
+ return preg_replace( "#=([\"'])(https?://{$domain})?$preg_path/((?:(?!\\1]).)+)\.(" . implode( '|', $this->extensions ) . ")(\?((?:(?!\\1).)+))?\\1#", '=$1//' . $this->cdn_domain . $path . '/$3.$4$5$1', $content );
# 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
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
@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);
@tollmanz
tollmanz / 01-need-jshint.txt
Last active December 27, 2015 15:39
Accounting of JS files in WordPress
wp-admin/js/about.js
wp-admin/js/accordion.js
wp-admin/js/color-picker.js
wp-admin/js/comment.js
wp-admin/js/common.js
wp-admin/js/custom-background.js
wp-admin/js/custom-header.js
wp-admin/js/customize-controls.js
wp-admin/js/dashboard.js
wp-admin/js/edit-comments.js