As configured in my dotfiles.
start new:
tmux
start new with session name:
| ! Molokai theme | |
| *xterm*background: #101010 | |
| *xterm*foreground: #d0d0d0 | |
| *xterm*cursorColor: #d0d0d0 | |
| *xterm*color0: #101010 | |
| *xterm*color1: #960050 | |
| *xterm*color2: #66aa11 | |
| *xterm*color3: #c47f2c | |
| *xterm*color4: #30309b | |
| *xterm*color5: #7e40a5 |
| function declOfNum(number, titles) { | |
| cases = [2, 0, 1, 1, 1, 2]; | |
| return titles[ (number%100>4 && number%100<20)? 2 : cases[(number%10<5)?number%10:5] ]; | |
| } | |
| use: | |
| declOfNum(count, ['найдена', 'найдено', 'найдены']); |
| // http://paulirish.com/2011/requestanimationframe-for-smart-animating/ | |
| // http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating | |
| // requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel | |
| // MIT license | |
| (function() { | |
| var lastTime = 0; | |
| var vendors = ['ms', 'moz', 'webkit', 'o']; |
As configured in my dotfiles.
start new:
tmux
start new with session name:
| # file: /etc/nginx/sites-available/example.com | |
| # nginx configuration for example.com | |
| server { | |
| listen 80; | |
| server_name example.com; | |
| access_log /srv/www/example.com/logs/access.log; | |
| error_log /srv/www/example.com/logs/error.log; | |
| # pass root to django |
| //This is the Backbone controller that manages the content of the app | |
| var Content = Backbone.View.extend({ | |
| initialize:function(options){ | |
| Backbone.history.on('route',function(source, path){ | |
| this.render(path); | |
| }, this); | |
| }, | |
| //This object defines the content for each of the routes in the application | |
| content:{ | |
| "":_.template(document.getElementById("root").innerHTML), |
| http { | |
| map $http_user_agent $limit_bots { | |
| default ''; | |
| ~*(google|bing|yandex|msnbot) $binary_remote_addr; | |
| } | |
| limit_req_zone $limit_bots zone=bots:10m rate=1r/m; | |
| server { |
| /* | |
| Функция для одновременной подсветки ссылок с одинаковым href, | |
| на вход принимает: | |
| 1) selector — джеквери-селектор ссылок, чтобы | |
| была возможность включить дублирующую подсветку в определённом фрагменте; | |
| 2) hoverClass — какой класс добавить по ховеру и псевдо-ховеру. | |
| Инициализация для всего документа: | |
| doubleHover('a', 'hover'); |
| // Декорируем фиксированные по высоте блоки | |
| @mixin _decorate($img, $tailTop) { | |
| background-image: image-url($img); | |
| background-repeat: no-repeat; | |
| position: absolute; | |
| width: 50%; | |
| height: image-height($img); | |
| top: 0; | |
| @if $tailTop != 0 { | |
| margin-top: -$tailTop; |
| /** | |
| * I converted the SCSS mixin to LESS for the awesome coders like myself in response to a blog post on 37Signals - http://37signals.com/svn/posts/3271-easy-retina-ready-images-using-scss | |
| * | |
| * Update: 2014-08-04 - Updated a long-standing bug where retina images were shown no matter what in the first background-image property. | |
| * - Updated retina media query to be more reliable () | |
| * Update: 2013-11-13 - Picked up another technique thanks to reading this post from Tyler Tate, auto-fill in the second filename for the retina image, http://tylertate.com/blog/2013/06/11/retina-images-using-media-queries-and-LESS-CSS.html | |
| * Update: 2013-04-16 - Have recently found a few use cases when using a retina pattern from Subtle Patterns on the <body>, this has come in handy | |
| * Update: 2013-04-05 - Some research in the Wordpress Core(http://core.trac.wordpress.org/ticket/22238#comment:5) was pointed out that some tests may be redundant (Thanks @kbav) so I've cleaned these up | |
| * Update: 2012-12-29 - U |