Skip to content

Instantly share code, notes, and snippets.

@Bartunek
Bartunek / rem.styl
Created January 3, 2017 13:26 — forked from nDmitry/rem.styl
Stylus mixin for rem units with fallback.
/**
* rem with fallback to px
*
* Use px as unit and only within a property.
* Default root font-size is standard 16px.
*
* Example:
* p {
* font-size: rem(18px);
* box-shadow: 0 0 rem(7px) #000;
@Bartunek
Bartunek / post-merge
Last active December 12, 2016 16:01 — forked from sindresorhus/post-merge
git hook to run a command after `git pull` if a specified file was changed.In this example it's used to run `npm install` if package.json changed. Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
#!/usr/bin/env bash
# MIT © Sindre Sorhus - sindresorhus.com
# git hook to run a command after `git pull` if a specified file was changed
# Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)"
check_run() {
echo "$changed_files" | grep --quiet "$1" && eval "$2"
$sprites: sprite-map("sprites/*.png");
$sprites-retina: sprite-map("sprites-retina/*.png");
@mixin sprite-background($name) {
background-image: sprite-url($sprites);
background-position: sprite-position($sprites, $name);
background-repeat: no-repeat;
display: block;
height: image-height(sprite-file($sprites, $name));
width: image-width(sprite-file($sprites, $name));