Skip to content

Instantly share code, notes, and snippets.

View yacine's full-sized avatar
🎯
Focusing

Yacine Benzerroug yacine

🎯
Focusing
View GitHub Profile
@yacine
yacine / alignment.less
Last active August 29, 2015 14:17
CSS / LESS alignment mixin
#align {
.horizontal(@el-width) {
left: 50%;
right: initial;
margin-left: -(@el-width/2);
}
.vertical(@el-height) {
top: 50%;
bottom: initial;
margin-top: -(@el-height/2);
@yacine
yacine / img-density.less
Created March 22, 2015 11:12
LESS mixin for setting different image densities and background sizes
// image densities
// --------------------------------------------------
@img-path: "img/";
.img-density(@file, @img-width:100%, @img-height:auto) {
@basefile: ~`(function(){ return @{file}.replace(/([^\.]*)\.(.*)/, '$1'); })()`;
@ext: ~`(function(){ return @{file}.replace(/([^\.]*)\.(.*)/, '$2'); })()`;
background-image: url("@{img-path}@{basefile}.@{ext}");
background-size: @img-width @img-height;
@media
@yacine
yacine / triangle.less
Created March 8, 2015 12:00
LESS Triangle
// source https://css-tricks.com/snippets/css/css-triangle/
.square(@size) {
width: @size;
height: @size;
}
.arr-dir(h, @bw) {
border-top: @bw solid transparent;
border-bottom: @bw solid transparent;
@yacine
yacine / pic.sublime-snippet
Last active October 12, 2016 22:35
Sublime text lorempixel snippet
<snippet>
<content><![CDATA[
<img src="http://lorempixel.com/${1:200}/${2:200}/${3:abstract}/" alt="image $1 x $2"/>
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>pixum</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<!-- <scope></scope> -->
</snippet>
@yacine
yacine / gist:1860517
Created February 18, 2012 18:20 — forked from lucasfais/gist:1207002
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt