Skip to content

Instantly share code, notes, and snippets.

View robhrt7's full-sized avatar

Robert Haritonov robhrt7

View GitHub Profile
@robhrt7
robhrt7 / headings.css
Last active August 29, 2015 13:56
CSS headings
/*
CSS hedings
==============================================================================================
*/
/* Level 1
---------------------------------------------------------------------------------- */
.somecode {
@robhrt7
robhrt7 / order.css
Last active August 29, 2015 13:56
CSS properties order
/*
CSS properties order
==============================================================================================
*/
.class {
position: relative;
right: 0;
left: 0;
z-index: 77;
@robhrt7
robhrt7 / comments.css
Last active August 29, 2015 13:56
Комментарии в CSS
/*
Комментарии в CSS
==============================================================================================
*/
/*
Нужно комментировать все не однозначные свойства и значения.
*/
@robhrt7
robhrt7 / organisation.css
Last active August 29, 2015 13:56
CSS organisation
/*
CSS organisation principles
==============================================================================================
*/
.elem-no-rules {}
.elem-no-rules_child {
display: inline-block;
}
@robhrt7
robhrt7 / description.css
Created February 17, 2014 20:57
Description and TODOs in CSS
/**
* author: robert.haritonov | skype : haritonov.r
* spec: http://link
* created: 05.12.13
*
* comments:
* @project class:
* @project colors:
**/
@robhrt7
robhrt7 / gist:bd857f570adaf2872c37
Created June 26, 2014 14:44
Custom Grunt script for couting CSS imports count, and seperating files before hitting IE limit of 31 imports
/*
Processing CSS @imports file, and counting how much @imports it includes.
If import count reaches the limit of 31 files (in IE8-9) and more, script will create additional CSS files:
input.css:
@import 1;
...
@import 36;
@robhrt7
robhrt7 / gist:d8ec45b39c27ade30757
Created June 26, 2014 14:57
Reading Grunt config from custom functions in Gruntfile.js for further use in config
/*
Usefull snippent for this kind of custom Grunt functions https://gist.github.com/operatino/bd857f570adaf2872c37
*/
module.exports = function (grunt) {
var baseConfig = {
foo: 'bar'
@robhrt7
robhrt7 / route.js
Created July 1, 2015 09:08
SourceJS route example: bower_components from root to local
var url = require('url');
var path = require('path');
var fs = require('fs');
var specUtils = require(path.join(global.pathToApp, 'core/lib/specUtils'));
var prevRef = 'http://google.com';
// Search requested resource in ref path first
var searchInRefPath = function(req, res, next){
var originalUrl = req.originalUrl;
<!-- Template to be transformed into Shadow DOM -->
<template>
<a href="" class="button">Button</a>
<script>
document.querySelectorAll('.button'); // Document is global, but how to reference current Shadow DOM document?
</script>
<template>