Skip to content

Instantly share code, notes, and snippets.

View zoxon's full-sized avatar

Zoxon zoxon

View GitHub Profile
@zoxon
zoxon / gist:7433bcf7ebffa27f17d8
Last active August 29, 2015 14:04
Stylus: User select none
-webkit-touch-callout none
-khtml-user-select none
user-select none
@zoxon
zoxon / gist:cba60d6dc0bcf8d6bcd3
Created September 21, 2014 05:34
Css: User select none
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
@zoxon
zoxon / gist:748d80a7dcb6730b0321
Created September 21, 2014 05:53
Stylus: IE7 hack selector
*:first-child+html &
@zoxon
zoxon / css-weight-vs-font-weight.txt
Created December 10, 2014 06:20
Css weight and equal font weight
|------------|-------------|
| CSS Weight | Font Weight |
|------------|-------------|
| 100 | Ultra Light |
| 200 | Thin |
| 300 | Light |
| 400 | Regular |
| 500 | Roman |
| 600 | Medium |
| 700 | SemiBold |
@zoxon
zoxon / css-bolder-lightter-cheatsheet.txt
Last active August 29, 2015 14:11
Css Bolder and Lighter cheatsheet
|-------------------|--------|---------|
| Исходное значение | bolder | lighter |
|-------------------|--------|---------|
| 100 | 400 | 100 |
| 200 | 400 | 100 |
| 300 | 400 | 100 |
| 400 | 700 | 100 |
| 500 | 700 | 100 |
| 600 | 900 | 400 |
| 700 | 900 | 400 |
# EditorConfig is awesome: http://EditorConfig.org
# top-most EditorConfig file
root = true
# Unix-style newlines with a newline ending every file
[*]
end_of_line = LF
insert_final_newline = true
indent_style = tab
var formatPrice = function(x) {
var parts = x.toString().split(".");
parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, " ");
return parts.join(".");
};
var removeAllSpaces = function(str) {
return str.replace(/ /g,'');
};
/**
* Преобразует HEX-представление цвета в RGB.
* @param {String} hex
* @return {Array}
*/
var hex2Rgb = function(hex) {
if ('#' == hex.substr(0, 1)) {
hex = hex.substr(1);
}
if (3 == hex.length) {
/**
* Преобразует RGB-представление цвета в HEX.
* @param {Array} rgb
* @return {String}
*/
var rgb2Hex = function(rgb) {
var s = '0123456789abcdef';
return '#' + s.charAt(parseInt(rgb[0] / 16)) + s.charAt(rgb[0] % 16) + s.charAt(parseInt(rgb[1] / 16)) +
s.charAt(rgb[1] % 16) + s.charAt(parseInt(rgb[2] / 16)) + s.charAt(rgb[2] % 16);