Skip to content

Instantly share code, notes, and snippets.

View zuDevonRW's full-sized avatar
🎯
Focusing

Devon RW zuDevonRW

🎯
Focusing
  • zu.com
  • Saskatoon, Saskatchewan, Canada, Earth, Milky Way Galaxy, Universe #?
View GitHub Profile
@zuDevonRW
zuDevonRW / px-n-rem
Last active December 30, 2015 19:39
Generate selectors with px and enhance to rems nicely and easily. Requires Foundation 5
@mixin px-n-rem($selector,$size)
#{$selector}: #{$size}px
#{$selector}: +rem-calc($size)
## Usage example
.something
+px-n-rem('padding', 16)
## Gives you
@zuDevonRW
zuDevonRW / _placeholder.sass
Created March 10, 2015 19:38
Generate placeholder psuedo-elements
=input-placeholder
&.placeholder
@content
&:-moz-placeholder
@content
&::-moz-placeholder
@content
&:-ms-input-placeholder
@content
&::-webkit-input-placeholder
@zuDevonRW
zuDevonRW / gist:d1d0fc1dcffbe6d7e422
Created April 2, 2015 14:51
PHP Unit test on pre-commit
#!/bin/bash
# Locate our phpunit.
phpunit=`which phpunit`
# Define a location to save the output.
outputlog="/tmp/phpunit_output_`date +%s`.log"
# Get name of the project (probably topmost directory name).
projectname=${PWD##*/}
@zuDevonRW
zuDevonRW / gist:d08e3fc211dbeee4cdd8
Created July 14, 2015 15:47
Run scss-lint from pre-commit
# run scss-lint
scssLintResult=$(scss-lint -c scss-config.yml)
if [[ $scssLintResult == "" ]]; then
echo "$(tput setaf 2)scss lint Passed$(tput sgr0)"
else
echo "$(tput setaf 1)scss lint: $result error(s), aborting commit$(tput sgr0)"
scss-lint -c scss-config.yml
exit 1
fi
@zuDevonRW
zuDevonRW / gist:560e8e1abf5364508ee5d0d2e71ee767
Created May 13, 2016 17:41
service worker error message
Error: {"columnNumber":-1,"lineNumber":-1,"message":"ServiceWorker failed to install: ServiceWorker failed to handle event (event.waitUntil Promise rejected)","sourceURL":""}
Console: {"lineNumber":0,"message":"Uncaught (in promise) TypeError: Request failed","message_level":3,"sourceIdentifier":1,"sourceURL":""}
@zuDevonRW
zuDevonRW / pe-calc.scss
Created January 27, 2017 20:46
pe-calc mixin
@mixin pe-calc($property, $formula, $fallback) {
#{$property}: $fallback;
#{$property}: calc(#{$formula});
}
// usage
@include pe-calc(width, '100% - 100px - 18px', 70%);
$supportsGrid: TRUE;
@mixin supportsGrid() {
@if $supportsGrid == TRUE {
@supports (display: grid) {
@content;
}
}
}