Skip to content

Instantly share code, notes, and snippets.

View david-binda's full-sized avatar

David Biňovec david-binda

View GitHub Profile
@david-binda
david-binda / gist:8471299
Last active January 3, 2016 13:39
Fix for a SSL update of Twitter oembed API for WordPress by Parade dev team ( http://www.parade.com ). Quick fix till we get an core update. See: https://core.trac.wordpress.org/changeset/26967 . Might require you to resave post in which oembed request failed previously as oembeds are being cached ( see: https://github.com/WordPress/WordPress/bl…
add_filter( 'oembed_providers', 'oembed_fix_twitter', 10, 1 );
function oembed_fix_twitter( $providers = array() ){
$providers[ '#https?://(www\.)?twitter\.com/.+?/status(es)?/.*#i' ] = array( 'https://api.twitter.com/1/statuses/oembed.{format}', true );
return $providers;
}
@lkarsten
lkarsten / default.vcl
Last active April 23, 2021 18:32
varnish vcl for ghost blogging platform
#
# Varnish VCL file for Ghost blogging platform.
# http://ghost.org/
#
# Written for Ghost v0.3.0.
#
# This is a low-hanging-fruit type of VCL. TTL of objects are overridden to 2
# minutes, and everything below /ghost/ is pass()-ed so the user sessions
# work.
#
@psebborn
psebborn / countCSSRules.js
Last active April 25, 2023 11:43
Count the number of rules and selectors for CSS files on the page. Flags up the >4096 threshold that confuses IE
function countCSSRules() {
var results = '',
log = '';
if (!document.styleSheets) {
return;
}
for (var i = 0; i < document.styleSheets.length; i++) {
countSheet(document.styleSheets[i]);
}
function countSheet(sheet) {