Skip to content

Instantly share code, notes, and snippets.

View cvan's full-sized avatar
🚌
🌊

Christopher Van Wiemeersch cvan

🚌
🌊
View GitHub Profile

Screencapture and animated gifs

I say "animated gif" but in reality I think it's irresponsible to be serving "real" GIF files to people now. You should be serving gfy's, gifv's, webm, mp4s, whatever. They're a fraction of the filesize making it easier for you to deliver high fidelity, full color animation very quickly, especially on bad mobile connections. (But I suppose if you're just doing this for small audiences (like bug reporting), then LICEcap is a good solution).

Capturing (Easy)

  1. Launch quicktime player
  2. do Screen recording

screen shot 2014-10-22 at 11 16 23 am

@PaulKinlan
PaulKinlan / builder.html
Last active May 19, 2019 16:55
Bookmark Builder
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Bookmarklet</title>
<script>
window.onload = function(e) {
var bookmark = document.getElementById("bookmark");
var code = document.getElementById("code");
@bradp
bradp / setup.sh
Last active April 18, 2025 02:11
New Mac Setup Script
echo "Creating an SSH key for you..."
ssh-keygen -t rsa
echo "Please add this public key to Github \n"
echo "https://github.com/account/ssh \n"
read -p "Press [Enter] key after this..."
echo "Installing xcode-stuff"
xcode-select --install
`
<h2>Messages (${ messages.length }):</h2>
<ul>
${ messages.map(((msg, i) => `
<li class="${ i % 2 ? 'odd' : 'even' }">
${ msg.subject }
${ msg.read ?
`this message is read`
:
`this message is unread`
function Debounce(fn, ms) {
this.timeout = null;
this.fn = fn;
this.ms = ms;
}
Debounce.prototype.start = function () {
this.timeout = setTimeout(this.fn, this.ms);
};
Debounce.prototype.reset = function () {
this.abort();
@addyosmani
addyosmani / README.md
Last active May 10, 2025 11:24 — forked from 140bytes/LICENSE.txt
108 byte CSS Layout Debugger

CSS Layout Debugger

A tweet-sized debugger for visualizing your CSS layouts. Outlines every DOM element on your page a random (valid) CSS hex color.

One-line version to paste in your DevTools

Use $$ if your browser aliases it:

~ 108 byte version

@lawnsea
lawnsea / strawman.md
Last active September 29, 2020 10:19
Hitching in a Web Worker

Goal

We would like to observe changes to the DOM and, for each changed element el, call one or more functions f1, f2, ..., fn, passing el as an argument to each. For each function, if it returns true, add a CSS class C to el, and otherwise remove class C from el.

Solution

Register a mutation observer on the root element of the DOM. The mutation observer is responsible for tracking the "generation" of all elements in the DOM and for marshalling MutationRecords to a Web Worker. Specifically:

  1. For each mutation:
  • increment the generation of the mutated element and its ancestors
@hdragomir
hdragomir / sm-annotated.html
Last active February 2, 2025 02:22
The deferred font loading logic for Smashing Magazine. http://www.smashingmagazine.com/
<script type="text/javascript">
(function () {
"use strict";
// once cached, the css file is stored on the client forever unless
// the URL below is changed. Any change will invalidate the cache
var css_href = './index_files/web-fonts.css';
// a simple event handler wrapper
function on(el, ev, callback) {
if (el.addEventListener) {
el.addEventListener(ev, callback, false);
@Rich-Harris
Rich-Harris / promisify.md
Created June 2, 2014 14:19
promisify.md

Include this snippet to promisify any node function that uses the standard form:

var Promise = require( 'es6-promise' ).Promise,
    promisify;

promisify = (function ( slice ) {
	return function ( fn, context ) {
		return function () {
 var args = slice.call( arguments );
@stevenyap
stevenyap / Heroku_Staging.md
Last active June 11, 2019 16:09
Staging workflow on Heroku

This describes the workflow to use Heroku as a staging environment. It assumes you already have an existing heroku app in production.

# rename your git remote heroku to something else like production
git remote rename heroku production

# so now you will push as: git push production master

# create the staging app
heroku apps:create staging-appname