Skip to content

Instantly share code, notes, and snippets.

@aalexeev239
aalexeev239 / style.css
Created December 3, 2015 12:04
zero centering
.zero-centered {
/* get sure that width and height declared */
/* this is useful for images */
max-width: 100%;
max-height: 100%;
width: auto;
height: auto;
/* main part */
@aalexeev239
aalexeev239 / aa-zoomify.jsx
Created December 5, 2015 20:01
aa-zoomify
// copied from https://gist.github.com/davidmerrique/4066808
var inFolder = Folder.selectDialog("Please select folder to process");
var defaults = {
type: "w",
quality: 50,
sizes: [1680, 1000, 640]
};
@aalexeev239
aalexeev239 / style.styl
Last active May 4, 2016 16:14
toggle-btn
.toggle-btn
$time = .2s
$sz_item = 4px
$ofs = 10px
$gut_ver = 4px
// $sz_hor = 26px
$sz_hor = 50px
$sz_ver = $sz_item * 3 + 2 * $ofs + 2 * $gut_ver
$color = #f00
@aalexeev239
aalexeev239 / script.js
Created December 9, 2015 13:18
Generate table of contents for css
(function() {
var generate = function(sChapters, sPrefix, nFrom) {
var output1 = '', output2 = '';
var prefix = sPrefix || '';
var from = parseInt(nFrom) || 1;
var temp;
for (var i = 0; i < sChapters.length; i++) {
temp = prefix + (nFrom + i) + '. ' + sChapters[i];
output1 += temp + '\n';
output2 += '/\u002A---------- ' + temp + ' ----------\u002A/' + '\n';
@aalexeev239
aalexeev239 / meta.hbs
Last active September 18, 2018 11:53
OG markup
{{#if keywords}}
<meta name="keywords" content="{{keywords}}">
{{/if}}
{{#if description}}
<meta name="description" content="{{description}}">
{{/if}}
{{#if fb_app_id}}
<meta name="fb:app_id" content="{{fb_app_id}}">
{{/if}}
{{#each og}}
@aalexeev239
aalexeev239 / Readme.md
Last active May 25, 2016 12:19
showReaction

Cистема общения в пул реквестах:

  1. Комментируем построчно в files changed, общаемся в conversation https://monosnap.com/file/fqP1MB5ZINTuFvfNQ9Ai0nNqOPyqwj

  2. Ученик, пофиксив правку, может поставить реакцию, например 👍.Так он сигнулизирует, что можно проверять https://monosnap.com/file/qUlpAYqHVQdRmengC3Jm43d9x1agzk

  3. Когда вновь просматриваем ПР, открываем старые комментарии. Если все ок, ставим под ним реакцию 🎉 (договоритесь с учеником, что эту реакцию ставит только наставник). https://monosnap.com/file/aOvqYiyY6w1GNXEYPYwBmY4ggWXJyi

@aalexeev239
aalexeev239 / form.php
Last active April 20, 2016 15:57
simple php submit
<?php
$FORM_EMAIL = "[email protected]"; // recepient
$FORM_EMAIL_FROM = "[email protected]"; // sender
$SITE_NAME = "foo.bar";
$EMPTY_FIELD_TEXT = " field is not filled";
$SUCCESS_TEXT = "Message successfully sent.";
$FAIL_TEXT = "Failed to send message";
$FORM_WAS_SUBMITTED_FROM = "Form was filled on ";
@aalexeev239
aalexeev239 / mailtest.php
Created April 24, 2016 21:41
simple script for testing email
<html>
<body>
<?php
if (isset($_REQUEST['from'])) { //if "email" is filled out, send email
//send email
$from = $_REQUEST['from'] ;
$toemail = $_REQUEST['toemail'] ;
$subject = $_REQUEST['subject'] ;
$message = $_REQUEST['message'] ;
@aalexeev239
aalexeev239 / kebab.html
Created June 2, 2016 10:47
kebab animation
<button class="kebab-wrap" type="button">
<span class="kebab"></span>
</button>
<script type="text/javascript">
var btn = document.querySelector('.kebab-wrap');
var kebab = btn.querySelector('.kebab');
btn.addEventListener('click', function(ev) {
ev.preventDefault();
kebab.classList.toggle('active');
@aalexeev239
aalexeev239 / search.js
Created February 7, 2017 06:36
swagger search bookmarklet
javascript:(function(){
function findByText(text) {
let resources = {};
const allItems = Array.prototype.slice.call(document.querySelectorAll('.resource .endpoint .operation .heading .path a'));
const items = allItems.filter((item) => {
return item.textContent.indexOf(text) >= 0;
});
items.forEach((item) => {
const resource = item.closest('.resource');