Skip to content

Instantly share code, notes, and snippets.

// Create a simple top to bottom linear gradient with a background-color backup
// The first argument, $color will be output as background-color: $color
//
// This yields a gradient that is 5% brighter on the top and 5% darker on the bottom
//
// +gradient-bg(#777)
//
// This yeilds a gradient where the bright and dark colors are shifted 10% from the original color.
// If you don't specify a third argument it will assign this value for the darkness too, keeping the gradient even.
//
@aral
aral / rem16px.styl
Created July 18, 2012 19:46
Work in progress… mixins for Stylus that handle 16px root em in a way that still gives you pixel parity
// Mixins
// Since some horrible browsers (e.g., on *spit* Android) don’t let you change the
// root em, I’m forced to use the browser default of 16px as the base. This mixin
// will help me keep sane by using units that correspond to pixel units.
line-height(h)
if unit(h) == "rem"
line-height: unit(h, 'px')
line-height: unit(h/16, 'rem')
@sheedy
sheedy / style-guides.md
Last active December 25, 2015 11:09
A list of "living" Style Guides

Style Guides

Add any links you want in this to the comments and I'll add them.

Grunt/JS/Handlebars

Generates styleguides from Markdown comments in CSS, SASS and LESS files using Handlebars

Node/JS

@marcamos
marcamos / modernizr-classes-ie.markdown
Last active December 31, 2015 18:29
* modernizr-classes-ie.markdown: A list of classes added to each version of IE, via Modernizr. * report-filtered-classes.js: If pre-defined classes *are* found on the HTML element (from Modernizr), log them to the console. You can do something entirely different, such as prepending a list of the found classes to the body element (for example).

Classes inserted into IE by Modernizr

Updated December 23rd, 2013: These lists were gathered from a Windows 7 virtual machine on a MacBook Pro.

IE11

  • js
  • flexbox
  • canvas
  • canvastext
@asciidisco
asciidisco / dalek_flocke.js
Created August 6, 2013 10:39
Many screenshots from different pages in different resolutions
module.exports = {
'A lot of screenshots': function (test) {
var resolutions = [{width: 1280, height: 1024}, {width: 1024, height: 768}, {width: 800, height: 600}];
var pages = ['http://facebook.com', 'http://twitter.com', 'http://dalekjs.com'];
resolutions.forEach(function (res) {
pages.forEach(function (page) {
test.open(page)
.resize(res)
@rodneyrehm
rodneyrehm / browser.js
Last active August 14, 2018 11:17
Looking to find low powered devices to disable animations and stuff
// https://github.com/bestiejs/platform.js
import platform from 'platform'
export const OS = (platform.os.family || '').toLowerCase()
export const ANDROID = OS === 'android'
export const IOS = OS === 'ios'
export const VERSION = parseFloat(platform.version)
export const MAJOR_VERSION = Math.floor(VERSION)
@chriseppstein
chriseppstein / _minified_filenaming.md
Last active November 26, 2019 07:40
compiling a minified version of css. This configures your compass project to emit files in minified form when compiling for production.
$ compass compile --environment production && compass compile

Afterwards you will have both the minified and non-minified versions in your output folder. Note that compass clean will not clean up your minified files.

@NielsLeenheer
NielsLeenheer / Samsung Browser
Last active June 23, 2020 11:33
Samsung Browser
Note: Some older devices such as the Galaxy S III did not get the Chromium based browser with
the update to Android 4.2 or later. When Samsung later introduced the Galaxy S3 Neo it did get
the new browser.
Note: With the Android 4.3 release and version 1.5 of the Chromium browser, Samsung did not
enable WebAudio API for the Note 3. All other devices did get the WebAudio API.
Note: Samsung did not update the browser version with the upgrade from Android 4.3 to 4.4,
but did add getUserMedia and WebRTC functionality.
@madrobby
madrobby / gist:2997187
Created June 26, 2012 17:13
The ultimate media query to rule them all ("all" being high DPI/"Retina" screens)
@media (min--moz-device-pixel-ratio: 1.5),
(-o-min-device-pixel-ratio: 3/2),
(-webkit-min-device-pixel-ratio: 1.5),
(min-device-pixel-ratio: 1.5),
(min-resolution: 1.5dppx) {
/* "retina" styles */
}
@codepo8
codepo8 / redirect
Last active June 29, 2021 16:58
Simple redirect of hotlinked images in .htaccess
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
# allowed domains, add as needed
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?google.com [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?christianheilmann.com [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?wait-till-i.com [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?mozilla.org [NC]
# search engines and social sites and stuff