Skip to content

Instantly share code, notes, and snippets.

View mathiasbynens's full-sized avatar

Mathias Bynens mathiasbynens

View GitHub Profile
@mathiasbynens
mathiasbynens / appify
Created November 12, 2010 13:46 — forked from subtleGradient/appify
appify — create the simplest possible Mac app from a shell script
#!/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
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 / LICENSE.txt
Last active October 5, 2022 10:38 — forked from 140bytes/LICENSE.txt
UTF-8 byte counter in 49 bytes
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
/*
* 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),

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 June 11, 2011 08:56 — 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)
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 07:47 — forked from 140bytes/LICENSE.txt
Google Analytics snippet in 140 bytes
Author: Mathias Bynens <http://mathiasbynens.be/>
This code is licensed under the WTFPL. Feel free to relicense as needed.
@mathiasbynens
mathiasbynens / jQuery.classList.js
Created July 16, 2010 07:34 — forked from boazsender/jQuery.classList.js
Fork of boaz’s jQuery.fn.classList() method with some minor improvements
/*
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 June 16, 2010 06:54 — forked from sstephenson/gist:439777
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 June 5, 2010 09:38 — forked from paulirish/gist:426012
Optimized version of amelie.js for IE6
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)})()}