Skip to content

Instantly share code, notes, and snippets.

View ixth's full-sized avatar
🎯
Focusing

Mikhail Menshikov ixth

🎯
Focusing
View GitHub Profile
function isValidDate(day) {
return !(this.earlierLimit && day < this.earlierLimit || this.laterLimit && day > this.laterLimit);
}
// O, why thou not use variables?!!
function isValidDate(day) {
var early = this.earlierLimit && day < this.earlierLimit,
late = this.laterLimit && day > this.laterLimit;
return !early && !late;
}
#!/bin/sh
REPO="git://github.com/phpmyadmin/phpmyadmin.git"
DEST="pma"
VER="RELEASE_3_5_7"
DIRS=
git clone ${REPO} "${DEST}" --no-checkout -b ${VER} --depth=1
(cd "${DEST}" && git reset && git checkout ${DIRS})
@ixth
ixth / gist:5612252
Created May 20, 2013 13:33
Random alphanumeric string generation
function randomChunk() {
return (Math.random() * Number.MAX_VALUE).toString(36);
}
function randomString(length) {
var result = '';
do {
var chunk = randomChunk();
var overhead = result.length + chunk.length - length;
@ixth
ixth / Белка.js
Created July 10, 2014 13:21
Белка.прячьОрехи
function Белка(орехи) {
this.орехи = [];
if (орехи.length) {
this.получиОрехи(орехи);
}
}
Белка.prototype.получиОрехи = function (орехи) {
Array.prototype.push.apply(this.орехи, орехи);
};
@ixth
ixth / jquery-serializeJSON.js
Last active August 29, 2015 14:07
jquery-serializeJSON.js
(function ($) {
$.fn.serializeJSON = function () {
return $.fn.serializeArray.call(this).reduce(function (result, param) {
result[param.name] = param.value;
return result;
}, {});
};
}(jQuery));
@ixth
ixth / test.eml
Created January 31, 2015 20:09
Inline images test
From: ixth <[email protected]>
To: [email protected]
Subject: test
Content-Type: multipart/related; boundary="iddqdboundary"
--iddqdboundary
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: 8bit
<!doctype html>
<html>
@ixth
ixth / submit.js
Last active August 29, 2015 14:15
$('[data-send-request] form').submit(self.submit);
$('[data-send-request] [data-send-request-submit]').click(self.submit);
//...
self.inProgress = false;
self.submit = function (event) {
e.preventDefault();
if (self.inProgress) {
return false;
}
@ixth
ixth / AdBlock.txt
Last active August 29, 2015 14:15
Blacklist annoying social networks comments
! Лочим виджеты «100500 пользователям нравится это»
|vk.com/widget_community.php*|
|facebook.com/plugins/like_box.php*|
## .fb-like-box, #vk_groups
! Лочим каменты на ютубе
|apis.google.com/*/*/*/*/*/widget/render/comments*|
youtube.com## #watch-discussion
! Лочим каменты в vk
@ixth
ixth / grid.sass
Last active August 23, 2017 16:11
$debug: false;
$column: 50px;
$gutter: 30px;
.wrap {
margin: 0 auto;
}
.row {
display: flex;
@ixth
ixth / index.html
Created January 30, 2018 08:26 — forked from Dmitry-7/index.html
vanillaJsSlider
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<header>
<div class="menu">