Skip to content

Instantly share code, notes, and snippets.

View dlewand691's full-sized avatar

Daniel Lewandowski dlewand691

View GitHub Profile
@xiaochengh
xiaochengh / explainer.md
Last active December 14, 2022 09:21
Explainer: Font Metrics Override Descriptors

Explainer: Font Metrics Override Descriptors

(A newer version is at here, where a new descriptor advance-override is added)

Spec

This doc explains descriptors ascent-override, descent-override and line-gap-override for CSS @font-face rule.

Basic usage:

@sarahdayan
sarahdayan / modifiers.scss
Last active November 15, 2024 15:56
Sass Modifiers Mixin
// ----
// Sass (v3.4.21)
// Compass (v1.0.3)
// ----
// Sass modifiers mixin by Sarah Dayan
// Generate All Your Utility Classes with Sass Maps: frontstuff.io/generate-all-your-utility-classes-with-sass-maps
// http://frontstuff.io
// https://github.com/sarahdayan
@spjpgrd
spjpgrd / Quick List - My Sketch Plugins.md
Last active August 6, 2018 21:09
These are the plugins I can count on to get the job done. Now, since there is such a huge variety, don't feel like you have to take my word and download every single one. Even I don't have every one of these installed on my machine right now 🙃

Quick List: My Sketch Plugins

My Sketch Plugins

First, download Sketch Runner to help you install these plugins easier. It's like Spotlight (or Alfred) for Sketch.

These are the plugins I can count on to get the job done. Now, since there is such a huge variety, don't feel like you have to take my word and download every single one. Even I don't have every one of these installed on my machine right now 🙃

This was compiled for the attendees of "A Really Good Beginner Sketch Workshop for Designers" for the Columbus Web Group, but why not share the love?

Alrighty, on the with the show 🎉

function isScrolledIntoView(elem)
{
var $elem = $(elem);
var $window = $(window);
var docViewTop = $window.scrollTop();
var docViewBottom = docViewTop + $window.height();
var elemTop = $elem.offset().top;
var elemBottom = elemTop + $elem.height();
@paulirish
paulirish / what-forces-layout.md
Last active April 26, 2025 02:35
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@mattes
mattes / make-a-call.alfredworkflow
Last active June 16, 2021 18:20
Place a call from Alfred using your iPhone (Mac OS X Yosemite & iOS 8)
@addyosmani
addyosmani / README.md
Last active April 27, 2025 19:48 — 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

@fta2012
fta2012 / DragTransform
Last active March 8, 2025 15:05
Slightly modified compiled coffeescript from this codepen: http://codepen.io/fta/pen/ifnqH. Paste into console on a page that has jQuery to load the two dependent libraries (jquery-ui and numericjs). Then call makeTransformable('#selector-name') to make that element WYSIWYG editable. Use inspector to get the CSS for the transforms.
var selector = 'img' // Replace this with the selector for the element you want to make transformable
jQuery.getScript('//ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js', function() {
jQuery.getScript('//cdnjs.cloudflare.com/ajax/libs/numeric/1.2.6/numeric.min.js', function() {
(function() {
var $, applyTransform, getTransform, makeTransformable;
$ = jQuery;
<div>
<label for="sort-by">Sort by</label>
<select id="sort-by">
<option value="manual">Featured</option>
<option value="price-ascending">Price: Low to High</option>
<option value="price-descending">Price: High to Low</option>
<option value="title-ascending">A-Z</option>
<option value="title-descending">Z-A</option>
<option value="created-ascending">Oldest to Newest</option>
<option value="created-descending">Newest to Oldest</option>
@razwan
razwan / _baseline.scss
Created April 14, 2014 16:20
Aligning type to baseline the right way with SASS
$base-font-size: 16px;
$base-line-height: 1.5;
// this value may vary for each font
// unitless value relative to 1em
$cap-height: 0.68;
@mixin baseline($font-size, $scale: 2) {