Skip to content

Instantly share code, notes, and snippets.


Andrew Householder aghouseh

View GitHub Profile
bennadel / RetryProxy.cfc
Created Jul 28, 2017
Creating A Generic Proxy For Retry Semantics In ColdFusion
View RetryProxy.cfc
output = false
hint = "I provide automatic retry functionality around the target component."
* I initialize the retry proxy with the given target component. Retries will
* only be applied to "transient" errors. And, since the proxy doesn't know which
* errors are transient / retriable, it must check with the isTransientError()
* function.
hissy / get_download_statistics.php
Created Apr 10, 2016
#concrete5 retrieve file download statistics
View get_download_statistics.php
$conn = Database::connection();
$qb = $conn->createQueryBuilder();
->orderBy('timestamp', 'ASC');
if ($startdate = $_GET['startdate']) {
nicolasembleton /
Last active Oct 21, 2022
Restart Bluetooth Daemon on Mac OS X without restarting
sudo kextunload -b
sudo kextload -b
bennadel / code-1.cfm
Last active Mar 21, 2020
What If ColdFusion Recognized More Truthy / Falsey Values
View code-1.cfm
hint="I determine if the given argument can be converted / shoe-horned into a boolean value. By default, we will be trying to create a FALSE; everything else will be TRUE.">
<!--- Define arguments. --->
sponomarev /
Created Nov 9, 2013
Remove iTerm2 icon from Dock
# remove
/usr/libexec/PlistBuddy -c 'Add :LSUIElement bool true' /Applications/
# restore
/usr/libexec/PlistBuddy -c 'Delete :LSUIElement' /Applications/
View jquery.doubletap.js
* jQuery Double Tap
* Developer: Sergey Margaritov (
* License: MIT
* Date: 22.10.2013
* Based on jquery documentation
jonathantneal /
Last active Mar 18, 2018
Apple Touch Icons

Apple Touch Icons

How many different ways can you slice an apple touch icon? At least 7.

<!-- iPhone, iPod Touch, older Android devices (57×57) -->
<link href="/apple-touch-icon-precomposed.png" rel="apple-touch-icon-precomposed">

<!-- iPad, iPad Mini (72×72) -->
<link href="/apple-touch-icon-72x72-precomposed.png" rel="apple-touch-icon-precomposed" sizes="72x72">
Integralist /
Last active Apr 25, 2020
This is how BBC News currently implements it's Image Enhancer for responsive images. Note: this is a completely rebuilt version of the code so the BBC's original source code doesn't actually look anything like the below example.

The BBC has a server-side image service which provides developers with multiple sized versions of any image they request. It works in a similar fashion to but it also handles the image ratios returned (where as doesn't).

The original BBC News process (and my re-working of the script) follows roughly these steps...

  • Create new instance of ImageEnhancer
  • Change any divs within the page (which have a class of delayed-image-load) into a transparent GIF using a Base64 encoded string.
    • We set the width & height HTML attributes of the image to the required size
    • We know what size the image needs to be because each div has custom data-attr set server-side to the size of the image
    • We then set a class of image-replace onto each newly created transparent image
  • We use a 250ms setTimeout to unblock the UI thread and which calls a function resizeImages which enhances the image-replace images so their source is now set to a URL whe
yorb / Snap to Pixels.jsx
Created Apr 23, 2013
A Photoshop script to snap all path points on selected shape layers to nearest pixels.
View Snap to Pixels.jsx
// Based on Adobe Community Forums member BlipAdobe's script:
#target photoshop
// Constants
var QUANTIZE_PIXELS = 1; // The number of whole pixels we wish the path points to be quantized to
var PIXEL_RATIO = app.activeDocument.resolution / 72; // Standardize pixels and points
// Some helpers