Skip to content

Instantly share code, notes, and snippets.

View crecotun's full-sized avatar

Alexei Crecotun crecotun

View GitHub Profile
@crecotun
crecotun / cloudSettings
Last active April 24, 2018 10:39
Visual Studio Code Settings Sync Gist
{"lastUpload":"2018-04-24T10:39:37.684Z","extensionVersion":"v2.9.0"}
@crecotun
crecotun / sprite.mixin.sass
Created March 20, 2016 06:16
Sprite mixin for sass
@mixin sprite($sprite)
$selector: #{&}
$hover: str-index($selector, 'hover')
$active: str-index($selector, 'active')
@if not ($active or $hover)
+spriteImage($sprite)
+spritePosition($sprite)
+spriteWidth($sprite)
@crecotun
crecotun / core.cson
Last active September 11, 2015 12:08
backbone module core
'.source.coffee':
'Core Backbone App':
'prefix': 'bb_module'
'body': '''
define [
'jquery'
'lodash'
'backbone'
'handlebars'
// js node
(function($node) {
if ($node.length) {
$node.el = $('.node--el', $node.el);
$node.el.show();
}
})( $('.node') );
@crecotun
crecotun / self-invoking.js
Last active August 29, 2015 14:22
Patterns
// Self invoking object
({
default: "Default",
init: function(name) {
var name = name ? name : this.default
console.log( "Hi, " + name );
}
}).init('Alex')
// self invoking function
@crecotun
crecotun / .coffee
Last active August 29, 2015 14:11
iconfont example
# generate iconfont from svgs
gulp.task 'common:iconfont', ->
gulp.src config.paths.src.common.svg.icons.all
.pipe g.iconfont
fontName: "icons"
appendCodepoints: true
normalize: true
.on 'codepoints', (codepoints) =>
codepoints.forEach (glyph, idx, arr) ->
arr[idx].codepoint = glyph.codepoint.toString(16)
@crecotun
crecotun / px to rem
Last active March 25, 2018 16:39
px to rem converter stylus mixin
rem()
values = ()
for i in arguments
push(values, i/16 rem)
return values
// e.g. padding rem(94px 0 75px)
@crecotun
crecotun / reset.styl
Created January 23, 2014 10:22
Eric Meyer reset in stylus format
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,