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
View about.md

Cards Against Humanity

Below are the white and black card sets published by Cards Against Humanity. Take them and come back with a bot. You have 48 hours, starting from an arbitrary time that I forget.

Black cards with 2 blanks are pick 2. Black cards with 3 blanks are pick 3, draw 2.

The rules are on the official web site.

These cards are taken from this PDF.

@mathiasbynens
mathiasbynens / LICENSE.txt
Created Jun 11, 2011 — forked from 140bytes/LICENSE.txt
Quick and dirty way to check if a given string can be used as an unquoted attribute value in HTML. (50 bytes)
View LICENSE.txt
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Mathias Bynens <http://mathiasbynens.be/>
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
@mathiasbynens
mathiasbynens / LICENSE.txt
Last active Jun 17, 2019 — forked from 140bytes/LICENSE.txt
UTF-8 byte counter in 49 bytes
View LICENSE.txt
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Mathias Bynens <http://mathiasbynens.be/>
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
@mathiasbynens
mathiasbynens / LICENSE.txt
Created May 23, 2011 — forked from 140bytes/LICENSE.txt
Google Analytics snippet in 140 bytes
View LICENSE.txt
Author: Mathias Bynens <http://mathiasbynens.be/>
This code is licensed under the WTFPL. Feel free to relicense as needed.
View defaultDisplay-jQuery-original.js
var elemDisplays = {},
// Store the iframe outside the function to reuse it
iframe,
iframeDoc;
function defaultDisplay( nodeName ) {
if ( !elemDisplays[ nodeName ] ) {
// Try the classical method first, which is far faster
var elem = document.createElement( nodeName ),
display;
@mathiasbynens
mathiasbynens / appify
Created Nov 12, 2010 — forked from subtleGradient/appify
appify — create the simplest possible Mac app from a shell script
View appify
#!/bin/bash
if [ "$1" = "-h" -o "$1" = "--help" -o -z "$1" ]; then cat <<EOF
appify v3.0.1 for Mac OS X - http://mths.be/appify
Creates the simplest possible Mac app from a shell script.
Appify takes a shell script as its first argument:
`basename "$0"` my-script.sh
@mathiasbynens
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
/*
Usages:
$(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
*/
jQuery.fn.extend({
classList: function(value) {
if (value) {
@mathiasbynens
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.
//
// http://37signals.com/svn/posts/2407-device-scale-user-interface-elements-in-ios-mobile-safari
// Copyright (c) 2010 37signals.
// Slightly optimized by Mathias Bynens <http://mathiasbynens.be/>
//
// 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
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)}document.body.style.filter="progid:DXImageTransform.Microsoft.MotionBlur(strength="+e+",direction="+c+",enabled='true')"}setTimeout(d,1000)})()}
View Optimized Clicky Asynchronous Tracking Code
/*
* See http://mathiasbynens.be/notes/async-analytics-snippet#comment-14
*/
<script>
var f = Function(),
clicky = { log: f, goal: f },
clicky_site_id = XXXXXX;
(function(d, t) {
var c = d.createElement(t),
You can’t perform that action at this time.