Skip to content

Instantly share code, notes, and snippets.

Avatar

Christopher Beloch CBeloch

  • Gronau / NRW / Germany
View GitHub Profile
@CBeloch
CBeloch / .bash_profile
Created Dec 7, 2015
My tuned .bash_profile for OS X
View .bash_profile
# 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)/'
}
View wp-rss-images.php
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 Nov 29, 2016
Giphy - Random GIF by Tag
View .htaccess
# 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 / SerienplakatNotifier.js
Last active Nov 6, 2017
Serienplakat notifier
View SerienplakatNotifier.js
/*
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'];
You can’t perform that action at this time.