Skip to content

Instantly share code, notes, and snippets.

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

Mike Yakymenko mikeyakymenko

🏠
Working from home
View GitHub Profile
@mikeyakymenko
mikeyakymenko / gist:3749143
Created September 19, 2012 11:23
Number list with sub list on css
ol>li{
display:block
}
ol>li:before{
content:counters(item,".") ". ";
counter-increment:item
}
ol{
counter-reset:item
}
@mikeyakymenko
mikeyakymenko / Python
Created September 19, 2012 19:55
Favicon
urlpatterns = patterns('',
(r'^favicon.ico$', 'django.views.static.serve',
{'document_root': settings.STATIC_ROOT, 'path': "favicon.ico"}),
)
@mikeyakymenko
mikeyakymenko / gist:5013295
Last active December 14, 2015 02:19
mediaqueries pattern..
@media all and (max-width: 1024px) {
/* styles for narrow desktop browsers and iPad landscape */
}
@media all and (max-width: 768px) {
/* styles for narrower desktop browsers and iPad portrait */
}
@media all and (max-width: 480px) {
/* styles for iPhone/Android landscape (and really narrow browser windows) */
@mikeyakymenko
mikeyakymenko / gist:5331975
Created April 7, 2013 19:02
jQuery для смены нескольких классов по клику.
<script type="text/javascript">
$(function(){
$('.none, .up, .down').click(function() {
this.className = {
down : 'none', none: 'up', up: 'down'
}[this.className];
return false;
});
})
</script>
@mikeyakymenko
mikeyakymenko / gist:5331981
Last active December 15, 2015 22:19
jQuery для смены многих класов по клику.
<script type="text/javascript">
$(function(){
$('.ex_sortlink2 a').click(function(){
var state = this.className;
state = state.split('state');
state = state[1];
state = parseInt(state);
state = (state + 1) % 5;
this.className = "state" + state;
return false;
@mikeyakymenko
mikeyakymenko / gist:5332141
Created April 7, 2013 19:39
Кодирование картинок в base64
#!/usr/bin/env python
# coding: utf-8
import os
import urllib
def rel(*x):
return os.path.join(os.path.abspath(os.path.dirname(__file__)), *x)
directory = rel()
@mikeyakymenko
mikeyakymenko / gist:5332156
Created April 7, 2013 19:40
Конвертация markdown файлов в html.
#!/usr/bin/env python
import os
import urllib
import markdown
def rel(*x):
return os.path.join(os.path.abspath(os.path.dirname(__file__)), *x)
directory = rel('md/')
@mikeyakymenko
mikeyakymenko / gist:5332167
Created April 7, 2013 19:43
Сортировака и копирование картинок в новую директорию. P.S. была такая надабность.
#!/usr/bin/env python
# coding: utf-8
import os
import shutil
import urllib
def rel(*x):
return os.path.join(os.path.abspath(os.path.dirname(__file__)), *x)
files = filter(lambda x: x.endswith('@2x.png'), os.listdir(rel()));
/*
#ie10 will only be red in MSIE 10,
both in high contrast (display setting) and default mode
*/
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
#ie10 { color: red; }
}
/*
* Author: http://stuffandnonsense.co.uk/blog/about/hardboiled_css3_media_queries/
*/
/* Smartphones (portrait and landscape) ----------- */
@media only screen
and (min-device-width : 320px)
and (max-device-width : 480px) {
/* Styles */
}