Skip to content

Instantly share code, notes, and snippets.

@bikubi
bikubi / chrome53_gpu_info_osx_broken-pannellum-multires.html
Last active October 19, 2016 15:20
chrome://gpu/ for a Chrome on OSX that has trouble rendering pannellum/multires
<html><body>
<p>There's output from a similar system which works <a href="#working">below</a>.</p>
<div>
<h3>Graphics Feature Status</h3>
<ul class="feature-status-list"><li><span>Canvas: </span><span class="feature-green">Hardware accelerated</span></li><li><span>Flash: </span><span class="feature-green">Hardware accelerated</span></li><li><span>Flash Stage3D: </span><span class="feature-green">Hardware accelerated</span></li><li><span>Flash Stage3D Baseline profile: </span><span class="feature-green">Hardware accelerated</span></li><li><span>Compositing: </span><span class="feature-green">Hardware accelerated</span></li><li><span>Multiple Raster Threads: </span><span class="feature-green">Enabled</span></li><li><span>Native GpuMemoryBuffers: </span><span class="feature-green">Hardware accelerated</span></li><li><span>Rasterization: </span><span class="feature-yellow">Software only, hardware acceleration unavailable</span></li><li><span>Video Decode: </span><span class="feature-green">Hardware a
@bikubi
bikubi / meltimagesslideshowbob.sh
Created September 5, 2017 08:52
Create a slideshow from images, with blending, using ffmpeg or MLT
#!/bin/bash
# create a slideshow from images, with nice blending
# using MLT or ffmpeg
# adapted from https://superuser.com/a/834035
#
# beware of the ffmpeg command, it eats memory quickly
# USAGE
# 1 pass images as arguments
@bikubi
bikubi / cagify.sh
Last active October 10, 2017 13:49
baseq3 cagifier
#!/bin/bash
# Replaces all textures in Q3A with Nick Cage, as pitched by Nerdcore
# http://www.nerdcore.de/2017/10/05/that-time-some-gamedev-replaced-every-texture-with-nicolas-cage/
# commenting on @AmazingThew
# https://twitter.com/AmazingThew/status/915787837349531648
# Example output:
# https://vimeo.com/237570637
#
# USAGE
@bikubi
bikubi / colon-zerowidthnojoin-close-parenthesis.sh
Last active August 6, 2018 20:13
create a smiley that won't be automagically emojized by facebook & copy to clipboard :‌)
# premade for copy&paste: :‌) ;‌) :‌( :‌D :‌P <‌3
php -r "echo html_entity_decode(':&zwnj;)');" | xclip -selection clipboard
@bikubi
bikubi / wp_queue_image.sh
Last active November 8, 2017 11:03
Quickly post an one-image-only post via WP-CLI.
#!/bin/bash
# Quickly create/queue an one-image-only post, tumblr-style.
img="$1"
title="$2"
status="$3"
category="image" # change this!
author=1 # also this.
@bikubi
bikubi / dialog.js
Created February 23, 2018 18:10
Synthesize a dialog via Chrome's built-in speech synthesis.
// Synthesize a dialog via Chrome's built-in speech synthesis.
// Hardcoded to British Male / US Female, slightly slowed down,
// with random pauses between lines.
// Copy&paste this into Chrome's Console.
// You might have to copy the first 2 lines individually / with delay / twice;
// getVoices() takes a while? (Chrome 57)
var msg = new SpeechSynthesisUtterance();
var voices = speechSynthesis.getVoices();
@bikubi
bikubi / wordpress-force-cropped-intermediates.php
Last active March 21, 2018 12:27
Force WordPress to use cropped intermediates for cropped image_sizes to maintain aspect ratios.
<?php
/* Force wp_get_attachment_image_src to always pick a cropped intermediate size.
* If we define a sequence of srcset-friendly image_sizes like this:
* add_image_size('gallery', 1000, 750, true);
* add_image_size('gallery_1', 707, 530, true);
* add_image_size('gallery_2', 500, 375, true);
* then WordPress might pick the image's original, _uncropped_, size, which
* might have a wrong aspect ratio. To limit wp_get_attachment_image() to
* cropped intermediates with the right aspect ratio only, we have to manually
* check the availability of the files.
@bikubi
bikubi / howto-record-nice-sounding-podcast-skype-linux.md
Last active November 12, 2018 06:13
How to record a nice sounding podcast over Skype, using Linux

How to record a nice sounding podcast over Skype, using Pulse and Ardour

The situation: we record a podcast over Skype. We both have USB audio interfaces (Behringer U-Phoria UMC202 and 404, respectively). We each record our respective audio inputs and mix those later, manually adjusting the delay. Skype is only used for communication and is not involved in the recording.

There might be a way to do this without ardour, pulse-only. But since we have ardour in our workflow already, we prefer this way, even if it seems needlessly complicated.

Tested on Arch Linux; all referenced programs refer to Arch packages.

@bikubi
bikubi / .htaccess
Created May 16, 2018 10:44
htaccess-https-redirect
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
</IfModule>
@bikubi
bikubi / gettexts-fake-update.sh
Last active March 3, 2021 15:04
Helper script for Roots' Sage starter theme: make WPML's String Translation see WordPress's l10n gettext function in PHP Blade templates, like {{ __('Foo', 'domain') }}
#!/bin/bash
# Scans blade templates for WordPress's gettext functions
# so WPML will pick them up for its String Translation.
# (WPML doesn't see something like {{ __('Hello World', 'sage') }}
# Put me into THEME/resources/assets/build
# so $fn will point to THEME/resouces and WPML can see it
# (and it's out of sage's way)