Skip to content

Instantly share code, notes, and snippets.

View skill83's full-sized avatar
😱
Focusing

Giovanni Battista Brescia skill83

😱
Focusing
View GitHub Profile
@skill83
skill83 / CSScomb.sublime-setting
Created October 4, 2017 10:59
#csscomb #config
{
"config": {
"remove-empty-rulesets": true,
"always-semicolon": true,
"color-case": "upper",
"block-indent": " ",
"color-shorthand": false,
"element-case": "lower",
"eof-newline": true,
"leading-zero": false,
@skill83
skill83 / mousetouch.js
Created March 22, 2017 09:59
Detect touch and mouse events
var getPointerEvent = function(event) {
return event.originalEvent.targetTouches ? event.originalEvent.targetTouches[0] : event;
};
var $touchArea = $('#touchArea'),
touchStarted = false, // detect if a touch event is sarted
currX = 0,
currY = 0,
cachedX = 0,
cachedY = 0;
@skill83
skill83 / blocktrans.sublime-snippet
Created April 19, 2016 09:30
wrap inside django template blocktrans
<snippet>
<content><![CDATA[{% blocktrans %}$SELECTION$1{% endblocktrans %}]]></content>
<!-- Optional: Tab trigger to activate the snippet -->
<tabTrigger>trans</tabTrigger>
<!-- Optional: Scope the tab trigger will be active in -->
<scope>source.html</scope>
<!-- Optional: Description to show in the menu -->
<description>Trans snippet</description>
</snippet>
@skill83
skill83 / trans.sublime-snippet
Created April 19, 2016 09:29
wrap inside django template trans
<snippet>
<content><![CDATA[{% trans '$SELECTION$1' %}]]></content>
<!-- Optional: Tab trigger to activate the snippet -->
<tabTrigger>trans</tabTrigger>
<!-- Optional: Scope the tab trigger will be active in -->
<scope>source.html</scope>
<!-- Optional: Description to show in the menu -->
<description>Trans snippet</description>
</snippet>
@skill83
skill83 / Default (OSX).sublime-keymap
Last active April 19, 2016 09:35
Sublime key binding user
[
{
"keys" : ["ctrl+shift+t"],
"command" : "insert_snippet",
"args" : {
"name": "Packages/User/trans.sublime-snippet"
}
},
{
"keys" : ["ctrl+alt+shift+t"],
@skill83
skill83 / size mixins
Last active April 19, 2016 09:45
less size mixin
//less mixin
.size(@string) {
@w: ~`(function(a){ return a.split(" x ").shift()+"px"; })( @{string})`;
@h: ~`(function(a){ return a.split(" x ").pop()+"px"; })( @{string})`;
width:@w;
height:@h;
}
//usage
#myId{
@skill83
skill83 / 0_reuse_code.js
Created October 21, 2013 10:38
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console