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 / 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
@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 / 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 / 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 / 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 / .showhiddenfiles.sh
Created January 11, 2016 07:58
Simple shell script that allows to show or not the hidden files in osx via terminal
# Usage
# $ showhiddenfiles 'Args'
# YES 'Default you can leave YES'
# NO
function showhiddenfiles () {
defaults write com.apple.finder AppleShowAllFiles -bool ${1:-YES}
killall Finder
}
@yacine
yacine / Preferences.sublime-settings
Created February 3, 2016 18:18
Sublime text preferences
{
"ignored_packages":
[
"jQuery",
"Markdown Preview",
"Vintage",
"WordPress"
],
"font_size": 14,
"tab_size": 4,
@yacine
yacine / screencapture.sh
Created February 9, 2016 18:15
Change OS X's Default Screenshot Format and Location
# Change format
defaults write com.apple.screencapture type jpg
# Change default location
mkdir ~/Pictures/Screenshots/
defaults write com.apple.screencapture location ~/Pictures/Screenshots/
killall SystemUIServer
@yacine
yacine / font-weight.less
Created May 24, 2016 14:29
Less - Font weight short cuts
// font weight
.font-thin { font-weight: 100; }
.font-light { font-weight: 300; }
.font-regular { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-bold { font-weight: 700; }
.font-black { font-weight: 900; }
@media (min-width: @screen-xs-min) {}
@media (min-width: @screen-sm-min) {}
@media (min-width: @screen-md-min) {}
@media (min-width: @screen-lg-min) {}
@media (min-width: @screen-xs-max) {}
@media (min-width: @screen-sm-max) {}
@media (min-width: @screen-md-max) {}