Skip to content

Instantly share code, notes, and snippets.

View akost's full-sized avatar
🏠
Working from home

Andrei K akost

🏠
Working from home
View GitHub Profile
@akost
akost / gist:4501571
Created January 10, 2013 12:10 — forked from Dimox/gist:4501510
if ($cat == $cat1 || $parent == $cat1) $class = 'cat1';
if ($cat == $cat2 || $parent == $cat2) $class = 'cat2';
if ($cat == $cat3 || $parent == $cat3) $class = 'cat3';
if ($cat == $cat4 || $parent == $cat4) $class = 'cat4';
if ($cat == $cat5 || $parent == $cat5) $class = 'cat5';
if ($cat == $cat6 || $parent == $cat6) $class = 'cat6';
if ($cat == $cat7 || $parent == $cat7) $class = 'cat7';
@akost
akost / gist:3871322
Created October 11, 2012 09:49 — 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
@akost
akost / har_request_urls.py
Created May 5, 2012 11:49
Parse a HAR (HTTP Archive) and return URLs which do not match specific domain
#!/usr/bin/env python
"""
Parse a HAR (HTTP Archive) and return URLs which do not match specific domain
HAR Spec: http://groups.google.com/group/http-archive-specification/web/har-1-2-spec
HAR can be saved, for example, from Chrome Developer Tools
Copyleft 2012 Andrei Kost <kost@kost.ru>
based Ian Gallagher <crash@neg9.org> script https://gist.github.com/892479
Example usage: ./har_request_urls.py foo.har
"""
With regard to any processes related to Telecommunication Services
and Additional Services provided by Operator
(including technical processes of message transmission,
receipt and processing), Moscow time shall apply.
@akost
akost / widgets.js
Created February 7, 2012 09:55 — forked from alkaruno/widgets.js
Widgets Library
/**
* Widgets Library
* @version 0.1
* @author Alexey Karunos (alkaruno@gmail.com)
* @example
* var widgets = new Widgets('http://site.com/widgets/');
* widgets.show('userinfo');
*/
;
function Widgets(urlPrefix, urlSuffix) {
@akost
akost / gist:1527315
Created December 28, 2011 09:29
Очередной БЭМ
.b-accordion .b-accordion-item .b-accordion-item-title .b-accordion-item-title-arrow {
float:left;
width:14px;
height:11px;
margin-top:7px;
background:url(../i/graphic.png) 0 -30px no-repeat;
}
.b-accordion .b-accordion-current-item .b-accordion-item-title .b-accordion-item-title-arrow {
float:left;
@akost
akost / gist:1505951
Created December 21, 2011 12:57
Emtpy line after bracket?
.b-accordion {
padding:0;
margin:0;
}
@akost
akost / talks.guns.ru.css
Created October 4, 2011 10:08
User CSS for talks.guns.ru
td {
padding:1em;
border-bottom:solid 1px #ccc;
line-height:1.5;
}
tr[bgcolor="#cccccc"] td,
tr[bgcolor="#ffffff"] td
{
padding:0;
@akost
akost / gist:1218774
Created September 15, 2011 07:52
Очередной перл, доставшийся в наследство
$id = intval($_REQUEST['sec']);
if ($id == '') { // будет TRUE, но зачем переводить в int, чтобы сравнивать со строкой?
$id = MENU_DEFAULT;
}
@akost
akost / gist:1180822
Created August 30, 2011 12:57
БЭМ?
.b-cartographic-care-centres-searching-form .b-form-contents .b-form-contents-map-points .b-form-contents-map-points-collection .b-form-contents-map-points-collection-cash-machines-clause .b-form-contents-map-points-collection-clause-icon {
background: url(i/_b-form-contents-map-points-collection-cash-machine-clause-icon.png) no-repeat 0 0;
}