Skip to content

Instantly share code, notes, and snippets.

Avatar

Giovanni Battista Brescia skill83

View GitHub Profile
View CSScomb.sublime-setting
{
"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 Mar 22, 2017
Detect touch and mouse events
View mousetouch.js
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 Apr 19, 2016
wrap inside django template blocktrans
View blocktrans.sublime-snippet
<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 Apr 19, 2016
wrap inside django template trans
View trans.sublime-snippet
<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 Apr 19, 2016
Sublime key binding user
View Default (OSX).sublime-keymap
[
{
"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 Apr 19, 2016
less size mixin
View size mixins
//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 Oct 21, 2013
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console