Skip to content

Instantly share code, notes, and snippets.

@yeah
yeah / advancedsettings.xml
Created July 14, 2013 14:03
This solved all my buffering troubles with high data rate videos streamed to xbmc running on my old ATV1! (Place it in ~/.xbmc/userdata/ and restart xbmc...)
<advancedsettings>
<network>
<cachemembuffersize>0</cachemembuffersize>
<!-- When set to 0 the cache will be written to disk instead of RAM, as of v12 Frodo -->
</network>
</advancedsettings>
@yeah
yeah / gist:3551456
Created August 31, 2012 11:00
Find a particular Car2Go
curl "http://www.car2go.com/portal/berlin/page/mybookings/mapEnlarged.faces" | grep -o 'B-GO2129"}[^}]\+}'
@yeah
yeah / Tumblr reverse proxy - Fixing redirects
Created May 8, 2012 15:23
Tumblr reverse proxy - Fixing redirects
# rewrite location headers in upstream redirects
proxy_redirect http://planio.tumblr.com/ /blog/;
proxy_redirect / /blog/;
@yeah
yeah / Tumblr reverse proxy - rewrite content using sub_filter
Created May 8, 2012 15:06
Tumblr reverse proxy - rewrite content using sub_filter
proxy_set_header Accept-Encoding ''; # prevent gzipped upstream as that would break sub_filter
# rewrite absolute urls in upstream body
sub_filter planio.tumblr.com plan.io/blog;
sub_filter_once off;
sub_filter_types text/xml;
@yeah
yeah / Tumblr reverse proxy - JavaScript redirect
Created May 8, 2012 14:55
Tumblr reverse proxy - JavaScript redirect
<script type="text/javascript">
if( window.location.hostname != "plan.io" ) {
window.location = "http://plan.io/blog" + window.location.pathname;
}
</script>
@yeah
yeah / Tumblr reverse proxy - Fixing relative links
Created May 8, 2012 14:41
Tumblr reverse proxy - Fixing relative links
@yeah
yeah / Tumblr reverse proxy - naive approach
Created May 8, 2012 14:34
Tumblr reverse proxy - naive approach
server {
listen 80;
server_name plan.io;
location /blog/ {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host planio.tumblr.com;
proxy_set_header REMOTE-HOST $remote_addr;
@yeah
yeah / gist:1429945
Created December 4, 2011 11:27
VPN configuration for FRITZ!Box connecting to a pfSense router using IPsec
vpncfg {
connections {
enabled = yes;
conn_type = conntype_lan;
name = "VPN tunnel to pfSense box at work"; // an identificator for your connection - pick anything
always_renew = no;
reject_not_encrypted = no;
dont_filter_netbios = yes;
localip = 0.0.0.0;
local_virtualip = 0.0.0.0;
@yeah
yeah / remove_diacritics.js
Created October 13, 2011 10:55
Remove diacritics (Umlauts, Accents, Special characters) in JavaScript
var diacriticsMap = [
{'base':'A', 'letters':/[\u0041\u24B6\uFF21\u00C0\u00C1\u00C2\u1EA6\u1EA4\u1EAA\u1EA8\u00C3\u0100\u0102\u1EB0\u1EAE\u1EB4\u1EB2\u0226\u01E0\u01DE\u1EA2\u00C5\u01FA\u01CD\u0200\u0202\u1EA0\u1EAC\u1EB6\u1E00\u0104\u023A\u2C6F]/g},
{'base':'AA','letters':/[\uA732]/g},
{'base':'AE','letters':/[\u00C4\u00C6\u01FC\u01E2]/g},
{'base':'AO','letters':/[\uA734]/g},
{'base':'AU','letters':/[\uA736]/g},
{'base':'AV','letters':/[\uA738\uA73A]/g},
{'base':'AY','letters':/[\uA73C]/g},
{'base':'B', 'letters':/[\u0042\u24B7\uFF22\u1E02\u1E04\u1E06\u0243\u0182\u0181]/g},
{'base':'C', 'letters':/[\u0043\u24B8\uFF23\u0106\u0108\u010A\u010C\u00C7\u1E08\u0187\u023B\uA73E]/g},
def auto_link_and_truncate(text)
auto_link(h(text), :html => {:target => '_blank', :rel => 'nofollow'}) do |t|
truncate(t,30)
end
end