Skip to content

Instantly share code, notes, and snippets.

View CBeloch's full-sized avatar

Christopher Beloch CBeloch

View GitHub Profile
@CBeloch
CBeloch / wp-rss-images.php
Created June 10, 2013 06:12
Fix for the following Wordpress plugin: http://wordpress.org/plugins/wp-rss-images/
if($enclosure){ // this is Line 78
list($width, $height, $type, $attr) = getimagesize($url);
echo '<enclosure url="' . $image_url . '" length="' . $filesize . '" type="'.image_type_to_mime_type($type).'" />';
}
if($media){
list($width, $height, $type, $attr) = getimagesize($url);
echo '<media:content url="'.$image_url.'" width="'.$width.'" height="'.$height.'" medium="image" type="'.image_type_to_mime_type($type).'" />';
}
@CBeloch
CBeloch / .htaccess
Last active November 6, 2020 11:25
Giphy - Random GIF by Tag
# Will allow to use a .gif extension.
# Script can now be used as www.mydomain.com/pokemon.gif
RewriteEngine on
RewriteRule ^(.*).gif giphy.php?tag=$1 [L,QSA]
@CBeloch
CBeloch / .bash_profile
Created December 7, 2015 10:05
My tuned .bash_profile for OS X
# Activate colors
export CLICOLOR='true'
export LSCOLORS="gxfxcxdxbxCgCdabagacad"
export EDITOR=vi
# Git branch in good-looking prompt.
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
@CBeloch
CBeloch / SerienplakatNotifier.js
Last active November 6, 2017 11:41
Serienplakat notifier
/*
Requires jsdom and request.
Grabs serienplakat.de to check for free posters
*/
var dom = require('jsdom');
var request = require('request');
var mainURL = 'http://serienplakat.de';
var detailURL = mainURL + '/backend/_ajax.php';
var scripts = ['http://code.jquery.com/jquery.js'];