Skip to content

Instantly share code, notes, and snippets.

View mathiasbynens's full-sized avatar

Mathias Bynens mathiasbynens

View GitHub Profile

Twitter abuses all media file uploads, each type in its own way. If we want to upload a good looking animation loop from some low-color, high-detail generative art, we have to game their system's mechanisms.

  • don't upload a video file, they will re-encode it into absolute 💩

  • create a GIF, which they will auto-convert into a video file 😱

  • The frames of the GIF will be resized to an even-sized width using an extremely naive algorithm. Your GIF should be an even size (1000, 2000,

@lhorie
lhorie / longest-keyword-sequence.md
Last active November 14, 2022 23:21
What's the longest keyword sequence in Javascript?
@ebidel
ebidel / download_chrome41.js
Last active February 14, 2024 01:56
For when you need to test your site in Google Search (Chrome 41).
/**
* Copyright 2018 Google Inc. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@ebidel
ebidel / feature_detect_es_modules.js
Last active September 4, 2023 13:56
Feature detect ES modules: both static import and dynamic import()
<!--
Complete feature detection for ES modules. Covers:
1. Static import: import * from './foo.js';
2. Dynamic import(): import('./foo.js').then(module => {...});
Demo: http://jsbin.com/tilisaledu/1/edit?html,output
Thanks to @_gsathya, @kevincennis, @rauschma, @malyw for the help.
-->
@addyosmani
addyosmani / sites.txt
Last active December 13, 2018 21:03
Sites using Webpack in production (BigQuery)
http://www.corral.net/
http://www.arizonasportsfans.com/
http://www.oi.com.br/
http://www.likeable.com/
http://www.nysportsday.com/
http://www.tstllc.net/
http://www.statnews.com/
http://www.springmobile.com/
http://www.folhadeparnaiba.com.br/
http://www.bilibili.com/
@joernchen
joernchen / PaintBleed.md
Created March 14, 2017 22:42
PaintBleed

Summary

mspaint.exe does not properly verify Dib data from the clipboard. Therefore we can craft some Dib data in the clipboard which e.g. suggests a size of 0x100 by 0x100 pixels and contains not more than the Dib header itself. So the acutal image data rendered by mspaint.exe is its own heap data =)

PoC

Run the following code in PowerShell:

$bytes = 40,0,0,0,0,1,0,0,0,1,0,0,1,0,24,0,0,0,0,0,136,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
@chicoxyzzy
chicoxyzzy / nvm-node-nightlies.md
Last active February 6, 2024 16:44
Installing Node Nightlies via nvm

You can install Node Nightlies/RCs via nvm using NVM_NODEJS_ORG_MIRROR environment variable.

Install latest Node RC

NVM_NODEJS_ORG_MIRROR=https://nodejs.org/download/rc/ nvm i node

Install latest Node.js Nightly

NVM_NODEJS_ORG_MIRROR=https://nodejs.org/download/nightly/ nvm i node
@cramforce
cramforce / on-idle.js
Created December 7, 2016 16:49
Wrapper around requestIdleCallback to wait for a minimum work budget
/**
* Delays calling the given function until the browser is notifying us
* about a certain minimum budget or the timeout is reached.
* @param {!Window} win
* @param {number} startTime When we started waiting for idle.
* @param {number} minimumTimeRemaining Minimum number of millis idle
* budget for callback to fire.
* @param {number} timeout in millis for callback to fire.
* @param {function()} fn Callback.
*/
@andreibosco
andreibosco / creative-cloud-disable.md
Last active January 3, 2024 02:37
disable creative cloud startup on mac
@peonso
peonso / Running CipSoft 7.7 files.md
Last active January 14, 2024 19:04
tutorial on make leaked 7.7 files running

Running CipSoft 7.7 files

tutorial on make leaked 7.7 files running

#1 First Steps

  1. First download VmWare workstation or virtual box and install.

  2. Now download CentOS 3.1 here: http://archive.kernel.org/centos-vault/3.1/isos/ download 3 disks and install in VmWare, I will not go into details about the Linux installation, you yourself must learn.

  3. Install VMware tools in CentOS or install one ftpserver, is recomended VMware tools (faster).