Skip to content

Instantly share code, notes, and snippets.

**basic rules**
- Top level className in the stylus file == top level className in the component
- They live in the same folder
- camelCase everything
- Child elements start with top-level module name separated by a hyphen ,
no matter how deeply they are nested
- please only use hyphens for this
- modifiers can be named however, but should be used with chain selector `&.modifier`
@mlabod
mlabod / batch_rename
Created March 2, 2016 13:51
Shell Batch Rename files
find . -name '*.tmpl' -exec sh -c 'mv "$0" "${0%.tmpl}.svg"' {} \;
'atom-text-editor':
'ctrl-s':'editor:toggle-soft-wrap'
@mlabod
mlabod / multiline.css
Last active March 2, 2016 13:50
Mutli line strike through with css
span {
line-height: 1.4;
background-image: linear-gradient(top, transparent 0em, transparent 0.63em, gray 0.63em, gray 0.7em, transparent 0.7em, transparent 1.4em);
background-size: 1.4em 1.4em;
background-repeat: repeat;
}
@mlabod
mlabod / placeholder.styl
Created March 27, 2014 15:17
Placeholder style mixin
placeholder(color = red)
&:-moz-placeholder
color: color
opacity: 1
&:-ms-input-placeholder
color: color
&::-webkit-input-placeholder
color: color
input
@mlabod
mlabod / grid.html
Created October 17, 2013 14:38
Dynamic Stylus Grid
<!-- usage -->
<div class="cols">
<div class="col col-50"></div>
<div class="col col-50"></div>
</div>
<div class="cols">
<div class="col col-33"></div>
<div class="col col-33"></div>
@mlabod
mlabod / gist:6151192
Created August 4, 2013 17:52
permissions for files and folders
chmod 755 $(find /path/to/base/dir -type d)
chmod 644 $(find /path/to/base/dir -type f)
@mlabod
mlabod / stylus_vendor_mixin.styl
Created April 29, 2013 12:59
Vendor aware stylus mixins
vendor(prop, args)
for prefix in vendors
if prefix == official
{prop}: args
else if transform in args
-{prefix}-{prop}: '-%s-%s' % (prefix args)
else
-{prefix}-{prop}:args
@mlabod
mlabod / dabblet.css
Created March 3, 2013 20:14
Pure CSS Loading Indicator
/**
* Pure CSS Loading Indicator
*/
@keyframes spin {
to {
transform:rotate(360deg);
}
}
@mlabod
mlabod / git_autocomplete
Last active December 13, 2015 23:59
Git Autocompletion in the terminal
# open terminal
$ curl https://raw.github.com/git/git/master/contrib/completion/git-completion.bash -o ~/.git-completion.bash
$ open ~/.bash_profile
# add
if [ -f ~/.git-completion.bash ]; then
. ~/.git-completion.bash
fi