Skip to content

Instantly share code, notes, and snippets.

Mathias Bynens mathiasbynens

Block or report user

Report or block mathiasbynens

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

Someone tried to exploit the Shellshock vulnerability in Bash on, likely as part of a mass-exploit attempt.

In this case, the exploit attempted to download a modified version of @schierlm’s pseudo-terminal Perl script that would connect to on port 23. The download URL contains the targeted host name (? which gives the attacker an indication of which hosts might have the /tmp/ backdoor in place.

View output.txt
mathiasbynens / Playing sounds on mouseover using jQuery
Created Nov 27, 2009
Playing sounds on mouseover using jQuery. Using <embed>, because who needs <audio> anyway‽
View Playing sounds on mouseover using jQuery
var $sound = $('<div id="sound" />').appendTo('body');
$('#special-links-that-play-annoying-sounds-when-hovered a').hover(function() {
$sound.html('<embed src="foo.mp3" hidden="true" autostart="true" loop="false">');
}, function() {
// We could empty the innerHTML of $sound here, but that would only slow things down.
mathiasbynens / jquery.cookie.js
Created May 13, 2010
Improved jQuery.cookie plugin
View jquery.cookie.js
mathiasbynens / Minified version
Created Jun 5, 2010 — forked from paulirish/gist:426012
Optimized version of amelie.js for IE6
View Minified version
if(document.all&&!window.XMLHttpRequest){(function(){var b=1,a=0,e,c;function d(){if(b==2){b=0}if(!b++){e=c=0;a=~~(Math.random()*10000)+2000;setTimeout(d,a)}else{e=~~(Math.random()*2)+2;c=~~(Math.random()*360);setTimeout(d,500)}"progid:DXImageTransform.Microsoft.MotionBlur(strength="+e+",direction="+c+",enabled='true')"}setTimeout(d,1000)})()}
mathiasbynens / Awesomify the Safari Reader UI bookmarklet
Created Jun 13, 2010
Awesomify the Safari Reader UI bookmarklet
View Awesomify the Safari Reader UI bookmarklet
// This works when used from the console with the Reader document open, but fails when used as a bookmarklet. Any ideas?
// See
javascript:(function(d){var s=d.createElement('style');s.appendChild(d.createTextNode('#background{background:#f773b5 url(}h1.title,.page{font-family:"Comic Sans MS"!important}h1.title{color:#f773b5}.page{background:rgba(255,255,255,.9);-webkit-animation-name:f;-webkit-animation-duration:5s;-webkit-animation-iteration-count:infinite;-webkit-animation-timing-function:linear}@-webkit-keyframes f{0%{-webkit-transform:rotate(0) scale(1)}25%{-webkit-transform:rotate(-4deg) scale(.95)}50%{-webkit-transform:rotate(0) scale(1)}75%{-webkit-transform:rotate(4deg) scale(.95)}100%{-webkit-transform:rotate(0) scale(1)}}'));d.head.appendChild(s)})(document)
mathiasbynens / Slightly optimized version of the ‘Device Scale UI elements in iOS Mobile Safari’ script by 37signals
Created Jun 16, 2010 — forked from sstephenson/gist:439777
Slightly optimized version of the ‘Device Scale UI elements in iOS Mobile Safari’ script by 37signals
View Slightly optimized version of the ‘Device Scale UI elements in iOS Mobile Safari’ script by 37signals
// Provides a device_scale class on iOS devices for scaling user
// interface elements relative to the current zoom factor.
// Copyright (c) 2010 37signals.
// Slightly optimized by Mathias Bynens <>
// 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
mathiasbynens / jQuery.classList.js
Created Jul 16, 2010 — forked from boazsender/jQuery.classList.js
Fork of boaz’s jQuery.fn.classList() method with some minor improvements
View jQuery.classList.js
$(selector).classList() // returns an array of classnames
$(selector).classList('newclass') // replaces the current element’s classes
$(selector).classList(['new', 'class', 'names']) // replaces the current element’s classes
classList: function(value) {
if (value) {
View jquery.togglefade.js
jQuery.fn.toggleFade = function(speed, callback) {
speed = ~~speed || 400;
callback = callback || jQuery.noop;
return this.each(function() {
var $this = jQuery(this);
$this[$':hidden') ? 'fadeIn' : 'fadeOut'](speed, callback);
You can’t perform that action at this time.