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
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: https://help.github.com/articles/creating-an-access-token-for-command-line-use
View gist:9476733
curl -H 'Authorization: token INSERTACCESSTOKENHERE' -H 'Accept: application/vnd.github.v3.raw' -O -L https://api.github.com/repos/owner/repo/contents/path
@madrobby
madrobby / localfonts.conf
Created Mar 28, 2013
Fontconfig for better renderings
View localfonts.conf
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<!-- from https://wiki.ubuntu.com/Fonts -->
<!--
.fonts.conf
release 6.3.23
Licensed under GNU GPL
================================
@madrobby
madrobby / everytimezone.coffee
Created Apr 17, 2011
First conversion of http://everytimezone.com/ JavaScript code to CoffeeScript
View everytimezone.coffee
# 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
madrobby / README.md
Created May 17, 2011 — forked from 140bytes/LICENSE.txt
Luhn10 algorithm
View README.md

Implementation of the Luhn 10 algorithm to check validity of credit card numbers. See http://en.wikipedia.org/wiki/Luhn_algorithm 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, http://mir.aculo.us/
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
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Thomas Fuchs <http://mir.aculo.us/>
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.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@madrobby
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
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 http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main' state=present
sudo: yes
- name: Add PostgreSQL repository key
apt_key: url=https://www.postgresql.org/media/keys/ACCC4CF8.asc state=present
sudo: yes
- name: Update apt cache
apt: update_cache=yes
@madrobby
madrobby / i18n.coffee
Created Nov 14, 2011
Backbone i18n with CoffeeScript
View i18n.coffee
# 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.