Skip to content

Instantly share code, notes, and snippets.

Thomas Fuchs madrobby

Block or report user

Report or block madrobby

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
madrobby / gist:9476733
Created Mar 10, 2014
Download a single file from a private GitHub repo. You'll need an access token as described in this GitHub Help article:
View gist:9476733
curl -H 'Authorization: token INSERTACCESSTOKENHERE' -H 'Accept: application/vnd.github.v3.raw' -O -L
madrobby / localfonts.conf
Created Mar 28, 2013
Fontconfig for better renderings
View localfonts.conf
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<!-- from -->
release 6.3.23
Licensed under GNU GPL
madrobby /
Created Apr 17, 2011
First conversion of JavaScript code to CoffeeScript
# Two things are important to note:
# 1) The code is fugly, because it was a JavaScript/iPad experiment.
# I know that it is ugly, so pretty please don't comment on that part.
# 2) I tried to use as many CoffeeScript features as possible,
# including but not limited to list comprehensions,
# heredocs, destructuring assignment and also the "do" operator
# I welcome comments about stuff that is not CoffeeScripty enough, or what I should
# write differently.
madrobby /
Created May 17, 2011 — forked from 140bytes/LICENSE.txt
Luhn10 algorithm

Implementation of the Luhn 10 algorithm to check validity of credit card numbers. See for details on the algorithm.

var validCreditCard = function(a,b,c,d,e){for(d=+a[b=a.length-1],e=0;b--;)c=+a[b],d+=++e%2?2*c%10+(c>4):c;return!(d%10)};

validCreditCard('378282246310005'); //=> true
validCreditCard('378282246310006'); //=> false

// some numbers to test with
// 378282246310005 371449635398431 378734493671000
View LICENSE.txt
Copyright (c) 2011 Thomas Fuchs,
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
View LICENSE.txt
Version 2, December 2004
Copyright (C) 2011 Thomas Fuchs <>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
madrobby / gist:3161015
Created Jul 22, 2012
Detect retina support. Tested on iOS, Android 2.x, Chrome for Android, Safari on MacBook Pro Retina, Firefox mobile (beta) for Android, Opera Mobile (Android)
View gist:3161015
function isRetina(){
return (('devicePixelRatio' in window && devicePixelRatio > 1) ||
('matchMedia' in window && matchMedia("(min-resolution:144dpi)").matches))
madrobby / gist:9628514
Last active Feb 7, 2019
Ansible actions to install a PostgreSQL 9.3 database server on Ubuntu 12.04
View gist:9628514
- name: Add PostgreSQL repository
apt_repository: repo='deb precise-pgdg main' state=present
sudo: yes
- name: Add PostgreSQL repository key
apt_key: url= state=present
sudo: yes
- name: Update apt cache
apt: update_cache=yes
madrobby /
Created Nov 14, 2011
Backbone i18n with CoffeeScript
# before this file is loaded, a locale should be set:
# In a browser environment, you can use:
# ```<script>__locale='en';</script>```
# In a server environment (specifically node.js):
# ```global.__locale = 'en';```
# normalize in-app locale string to "en" or "de-AT"
parts = @__locale.split('-')
View gist:9e2115ee79ae8d5c2b041a15d5c0575a
The nomination of Kavanaugh should be withdrawn.
He has shown that he does not have the decorum to be a judge, let alone on the Supreme Court.
He is overly aggressive, is untruthful and has made misleading statements.
He lied, blatantly, without hesitation, to your fellow Congressmen for his personal gain.
He is blaming everyone but himself, and is spinning weird conspiracy theories against political enemies.
You can’t perform that action at this time.