Skip to content

Instantly share code, notes, and snippets.

View morewry's full-sized avatar
💭
⛈ 🌩 ☁️ 🌧 ☁️ ⛈ 🌧 🌩 ☁️

Rhy Moore morewry

💭
⛈ 🌩 ☁️ 🌧 ☁️ ⛈ 🌧 🌩 ☁️
View GitHub Profile
@morewry
morewry / css_regression_testing.md
Created January 26, 2017 19:50 — forked from cvrebert/css_regression_testing.md
Survey of screenshot-based CSS testing tools

Currently considering https://github.com/webdriverio/webdrivercss


Core Goals:

  • Can test in up-to-date versions of all major browsers
  • Can test on up-to-date versions of all major OSes
  • Can test in IE9 (because Bootstrap v4 will support IE9+)
  • Don't want to have to setup/maintain our own cluster of VMs running all the necessary OSes (and all the versions of Windows)
  • Workflow for management of reference/baseline/norm screenshots
@morewry
morewry / what-forces-layout.md
Created August 18, 2016 23:24 — forked from paulirish/what-forces-layout.md
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.

Element

Box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
  • elem.clientLeft, elem.clientTop, elem.clientWidth, elem.clientHeight
  • elem.getClientRects(), elem.getBoundingClientRect()
@morewry
morewry / angularjs_directive_attribute_explanation.md
Created June 24, 2016 20:09 — forked from CMCDragonkai/angularjs_directive_attribute_explanation.md
JS: AngularJS Directive Attribute Binding Explanation

AngularJS Directive Attribute Binding Explanation

When using directives, you often need to pass parameters to the directive. This can be done in several ways. The first 3 can be used whether scope is true or false. This is still a WIP, so validate for yourself.

  1. Raw Attribute Strings

    <div my-directive="some string" another-param="another string"></div>
@morewry
morewry / _icons.scss
Created September 18, 2013 18:44
Compass sprites generate placeholders instead of classes (newer version doesn't require listfiles.rb)
$disable-magic-sprite-selectors: true;
$icons-inline: true;
$icons-sprite-base-class: "%icons-sprite";
$icons-layout: smart;
$icons: sprite-map("icons/*.png");
@import "icons/*.png";
@each $img in sprite-names($icons) {
%icon-#{$img} {
@extend %icons-sprite;
@morewry
morewry / Search-Nested-Backbone-LayoutManager-Views.js
Last active December 19, 2015 03:59
Backbone & Backbone Layout Manager - search for a nested view, recursive getView
// Pass in a starting view and match comparison
function findView ( startView, searchFn ) {
var resultView,
viewSearch = function ( curView ) {
curView.getView( function ( nestedView ) {
if ( searchFn( nestedView ) ) {
resultView = nestedView;
}
else {
viewSearch( nestedView );
@morewry
morewry / config.rb
Last active October 13, 2015 06:17
Customize compass sprite selectors as automatically as possible
# http://stackoverflow.com/questions/10314907/getting-a-list-of-files-in-sass-compass
require File.join(File.dirname(__FILE__), 'listfiles.rb')
@morewry
morewry / PngOutBatch.cmd
Created November 26, 2012 20:25 — forked from nicjansma/PngOutBatch.cmd
Runs a PNG through PngOut multiple times at different block sizes. More details @ http://nicj.net/2012/05/15/pngoutbatch
@echo off
setlocal enabledelayedexpansion
REM
REM PngOutBatch
REM
REM Nic Jansma - nic@nicj.net
REM
REM Runs a PNG through PngOut multiple times at different block sizes. Shows the
REM file-size savings during and at the end.
@morewry
morewry / compass-config-with-styledocco.rb
Created November 26, 2012 20:33
Compass config with styledocco to generate styleguide on compile
# we have a separate build process that strips comments & minifies, so I use production mode here to generate the styleguide
project_path = File.dirname(__FILE__) + "/"
utils_dir = "utilities/"
utils_path = project_path + utils_dir
output_style = (compiletype == :production) ? :expanded : :nested
# callback - on_stylesheet_saved
on_stylesheet_saved do |filename|
if File.exists?(filename)
if (compiletype == :production)
@morewry
morewry / _convert-units.scss
Created May 26, 2014 22:18
Sass convert length units
/*
# Convert Units (function)
TODO: Description
*/
// ---------------------------------------
@function convert-units ( $length, $as: rem, $root: 16, $ppi: 96 ) {
$unit: unit($length);
@morewry
morewry / sass-extend-or-include-wish
Created April 3, 2014 03:23
Something I wish I could do in Sass
// ---------------------------------------
/*
## Set / Get
http://cdpn.io/hgLal
*/
// ---------------------------------------