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
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.
View gist:8276a5c568b73a2b59fcc9418505e15e
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.
@madrobby
madrobby / # phantomjs - 2018-09-24_18-53-04.txt
Created Sep 24, 2018
phantomjs on macOS 10.14 - Homebrew build logs
View # phantomjs - 2018-09-24_18-53-04.txt
Homebrew build logs for phantomjs on macOS 10.14
Build date: 2018-09-24 18:53:04
@madrobby
madrobby / scrolltotop.annotated.js
Last active Sep 24, 2018
scrolltotop, a Zepto plugin to scroll things to the top (and any other vertical scroll position)
View scrolltotop.annotated.js
// Usage: $(element).scrollToTop([position])
;(function($){
// only allow one scroll to top operation to be in progress at a time,
// which is probably what you want
var scrollToTopInProgress = false
$.fn.scrollToTop = function(position){
var $this = this,
targetY = position || 0,
@madrobby
madrobby / gist:3733875
Created Sep 16, 2012
Fade out elements on WebKit and Firefox
View gist:3733875
<style>
.fade-right {
-webkit-mask-image: -webkit-gradient(linear, left top, right top, from(rgba(0,0,0,1)), color-stop(0.75, rgba(0,0,0,1)), to(rgba(0,0,0,0)));
mask: url(#fade_right_svg_mask);
}
#mask_demo {
background: #d0d0d0;
height: 100px;
width: 500px;
padding: 10px;
You can’t perform that action at this time.