Skip to content

Instantly share code, notes, and snippets.

View artpolikarpov's full-sized avatar

Artem Polikarpov artpolikarpov

  • Chatra.io
  • Saint Petersburg, Russia
View GitHub Profile
$(document).ready(function() {
$('.js-aims').each(function () {
var $this = $(this);
$this.on($this.data('aimEvent') || 'click', function () {
setAim($this.data('aim'));
});
});
});
@artpolikarpov
artpolikarpov / design-button.html
Created March 24, 2014 13:17
Оранжевая кнопка для писем
<div><!--[if mso]>
<v:roundrect xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w="urn:schemas-microsoft-com:office:word" href="http://getwear.com/ru/design/" style="height:31px;v-text-anchor:middle;width:200px;" arcsize="13%" stroke="f" fill="t">
<v:fill type="tile" src="http://static.getwear.com/b-knopka/design-gradient.png" color="#c96c3d" />
<w:anchorlock/>
<center style="color:#ffffff;font-family:sans-serif;font-size:13px;font-weight:bold;">Изменить дизайн</center>
</v:roundrect>
<![endif]--><a href="http://getwear.com/ru/design/"
style="background-color:#c96c3d;background-image:url(http://static.getwear.com/b-knopka/design-gradient.png);border-radius:4px;color:#ffffff;display:inline-block;font-family:sans-serif;font-size:13px;font-weight:bold;line-height:31px;text-align:center;text-decoration:none;width:200px;-webkit-text-size-adjust:none;mso-hide:all;">Изменить дизайн</a></div>
@artpolikarpov
artpolikarpov / verify-button.html
Created March 28, 2014 07:31
Зелёная кнопка для письма
<div><!--[if mso]>
<v:roundrect xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w="urn:schemas-microsoft-com:office:word" href="%%VERIFY-URL%%" style="height:31px;v-text-anchor:middle;width:250px;" arcsize="13%" stroke="f" fill="t">
<v:fill type="tile" src="http://static.getwear.com/verify-gradient.png" color="#a8d2a3" />
<w:anchorlock/>
<center style="color:#000;font-family:sans-serif;font-size:13px;font-weight:bold;">%%VERIFY-TEXT%%</center>
</v:roundrect>
<![endif]--><a href="%%VERIFY-URL%%"
style="background-color:#a8d2a3;background-image:url(http://static.getwear.com/verify-gradient.png);border-radius:4px;color:#000;display:inline-block;font-family:sans-serif;font-size:13px;font-weight:bold;line-height:31px;text-align:center;text-decoration:none;width:250px;-webkit-text-size-adjust:none;mso-hide:all;">%%VERIFY-TEXT%%</a></div>
@artpolikarpov
artpolikarpov / README.md
Last active August 29, 2015 13:59
Отзывчивые интерфейсы

Отзывчивые интерфейсы

Доклад был прочитан 15 апреля 2014-го на РИТе.

Презентация

http://share.artpolikarpov.ru/PjC6 ПДФ, 5,3 МБ

Список литературы (в процессе наполнения)

Никакое специальное приложение для проверки размеров в вёрстке, вроде ((http://xscopeapp.com/ Икс-скоупа)), у меня не прижилось. Слишком большая погрешность:
xScope@2x.png
Правильный размер 198×68
Когда мне нужно что-то проверить приблизительно, я использую стандартную маковскую скриншотилку, <tt>cmd shift 4</tt>:
grab@2x.png
После измерений нажимаю <tt>esc</tt>, чтобы не сохранять скриншот.
@artpolikarpov
artpolikarpov / fotorama.php
Created June 1, 2014 15:51
/system/neasden/extensions/fotorama.php
<?php
class NeasdenGroup_fotorama implements NeasdenGroup {
private $neasden = null;
function __construct ($neasden) {
$this->neasden = $neasden;
$neasden->require_line_class ('picture');
@artpolikarpov
artpolikarpov / .htaccess
Last active August 29, 2015 14:02
Аварийный .htaccess для Эгеи 2.4
DirectoryIndex index.php
ErrorDocument 404 "Looks like mod_rewrite does not work. Please set url_composition to 'real' in user/config.php then go to .../?go=@sync and then back to front page of your blog."
Options -Indexes -MultiViews +FollowSymLinks
<IfModule mod_rewrite.c>
RewriteEngine On
# Next lines fix mod_rewrite's trailing slash bug
var data = [{img: '1.jpg', html: '<div><a></a></div>'}, {img: '2.jpg', html: '<div><a></a></div>'}]
loaded;
$('#fotorama')
.on('fotorama:load fotorama:error', function (e, fotorama) {
if (!loaded) fotorama.load(data);
loaded = true;
})
.fotorama({
data: [data[0]]
// после scrollyeah.js
$(function () {
// ↓ селектор активного блока
$('.scrollyeah .one.active').each(function () {
var $current = $(this);
var $shaft = $current.parents('.scrollyeah__shaft');
var $scrollyeah = $current.parents('.scrollyeah');
if (!$current.length || !$shaft.length || !$scrollyeah.length) {
return console.warn('Незачем крутить :-/');
{
_id: "y3iK3rSwwHTSmQ5Sh",
createdAt: 1403426169619,
description: "Русско-британский институт управления, 24 июня 2014",
show: "all",
slides: [
{
class: "cover shout",
code: "<img src=\"http://www.creativeapplications.net/wp-content/uploads/2009/09/snail00.png\" alt=\"\">\r\n\r\n## <a style=\"color: #fff;;\" href=\"http://sho.io/gd\">sho.io/gd</a>\r\n\r\n<p class=\"title place t\">Презентация на вашем устройстве</p>\r\n\r\n<p class=\"comment place b r\"><a href=\"http://www.creativeapplications.net/processing/the-snail-on-the-slope-processing\">Image from 'The Snail on the Slope'</a>, by Vladimir Todorović, Processing</p>\r\n\r\n<style>\r\n\t.half {\r\n\t\twidth: 50%;\r\n\t}\r\n\tp {\r\n\t\twidth: 80%;\r\n\t\tline-height: 140%;\r\n\t}\r\n\t.white {\r\n\t\tcolor: #fff;\r\n\t}\r\n\r\n\t.smallcapitals {\r\n\t\tfont-size: .875em;\r\n\t\tletter-spacing: .15em;\r\n\t\tmargin-right: -.15em;\r\n\t }\r\n\r\n\t.overbox {\r\n\t\tpadding: 0 1em;\r\n\t\tcolor: #f0f0f0;\r\n\t\tbackground-color: