Skip to content

Instantly share code, notes, and snippets.

@orlovmax
orlovmax / gallery.sh
Created February 12, 2017 00:51
Bash gallery generator (slow)
@orlovmax
orlovmax / git-remove-tags.md
Created January 8, 2016 23:26
Delete tags

To delete remote tags (before deleting local tags) simply do:

git tag -l | xargs -n 1 git push --delete origin

and then delete the local copies:

git tag | xargs git tag -d

@orlovmax
orlovmax / .htaccess_redirect
Last active August 29, 2015 14:27
.htaccess redirect all stuff to index
RewriteEngine on
RewriteCond %{REQUEST_URI} !^/$
RewriteRule .* / [L,R=302]
@orlovmax
orlovmax / jade-blocks.jade
Last active November 21, 2016 12:40
Enhanced Jade templates - BEM blocks + pass some data
//LIVE EXAMPLE: http://codepen.io/orlovmax/pen/PZRXaN?editors=1000
// Define navigation mixin
mixin nav(args)
- items = args.items || {}
- active = args.active || {}
- nav = args.nav || {}
- list = args.list || {}
- item = args.item || {}
- item_active = args.item_active || {}
@orlovmax
orlovmax / stylus-bem
Last active August 29, 2015 14:22
Соглашение о порядке селекторов в стиле БЭМ в Stylus - Середина между 1 и 2 вариантами
// Блок
.block
// ...
// Начинаются штучки, касающиеся блока: медиа, миксины, псевдоклассы, псевдоэлементы
// @media-примеси блока и другие миксины
+below(640px)
// ...
// Псевдоэлементы блока
@orlovmax
orlovmax / jekyll-inclusion_create-post
Created May 26, 2015 21:20
Jekyll-inclusion template create new post
function jpost {
cp -a _dev/templates/pages/_drafts/_draft.md _dev/templates/pages/_posts/$@.md;
explorer "$(pwd -W | sed 's/\//\\/g')\_dev\templates\pages\_posts\\$@.md";
mkdir _dev/img/post/$@;
explorer "$(pwd -W | sed 's/\//\\/g')\_dev\img\post\\$@";
}
@orlovmax
orlovmax / stylus-iconfont
Created May 22, 2015 20:43
Stylus iconfont iteration
icons = next '\e804', prev '\e805', twi '\e806', loc '\e807', fb '\e808', pin '\e809', gplus '\e80a'
for icon in icons
&_{icon[0]}
&:before
content: icon[1]
@orlovmax
orlovmax / tag-head
Created May 17, 2015 15:12
Tag specific head and push it to the specific branch
git tag -a v1.3 cf50010 -m "v1.3"
or simplest way
git tag "v1.3" cf50010
git push --tags origin master
@orlovmax
orlovmax / gtags.txt
Created March 19, 2015 17:55
Git tags renaming and replacing
# Rename old to new
git tag new old
git tag -d old
git push origin :refs/tags/old
git push --tags
# Apply tag to some HEAD
@orlovmax
orlovmax / Icon font Sass workaround
Last active November 15, 2015 21:57
Icon font + pseudoelement Sass workaround
@function unicode($str)
@return unquote("\"")+unquote(str-insert($str, "\\", 1))+unquote("\"")
$icons: (next: 'e804', prev: 'e805', twi: 'e806', loc: 'e807', fb: 'e808', pin: 'e809', gplus: 'e80a')
@each $icon in $icons
&_#{nth($icon, 1)}
&:before
content: unicode(nth($icon, 2))