Skip to content

Instantly share code, notes, and snippets.

Andrey m8rge

Block or report user

Report or block m8rge

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
m8rge / git-anchors-check.js
Created Nov 24, 2014
Validate on page anchors consistence on github
View git-anchors-check.js
(function() {
$('article').find('a:not(.anchor)[href^=#]').each(function (i, e) {
var id = $(e).attr('href').replace(/^#/, '');
if ($('a[id="' + decodeURI(id) + '"]').length == 0) {
} else {
m8rge / tooltip-over-select2.js
Last active Sep 26, 2018
twitter bootstrap tooltip over select2
View tooltip-over-select2.js
* Declate title attribute on target select element.
* Initialize tooltip:
title: function() {
return $(this).next().attr("title");
m8rge / gist:7923382
Last active Dec 31, 2015
chef, будь он неладен
View gist:7923382
# Создание шаблона с sql созданием бд и пользователя
template "/var/tmp/getmail_create_tables.mysql" do
source "mysql/getmail.sql.erb"
mode "0600"
# только если пользователя бд нет
not_if "mysql -e \"\" -h localhost -P 3306 getmail"
# запускаем на выполнение
notifies :run, "execute[mysql_create_getmail_tables]", :immediately
m8rge / pullUpLastTag.php
Created Nov 15, 2013
Подтягивает последний тег до последнего коммита и пушит его в мастер.
View pullUpLastTag.php
#!/usr/bin/env php
<?php namespace App;
* @param string $command
* @return string[]
function exec($command)
echo "> $command\n";
View stringAndIntComparison.php
// we have some model attributes in array
$modelAttributes = array(
// also, we have new attributes in same array. This can occure if your html form contains elements with names:
// Model[Attribute][] = first
// Model[Attribute][] = second
m8rge / EMemCache.php
Last active Dec 11, 2015
Yii component EMemCache prevents dogpile effect. WARNING! EMemCache internal cache value format incompatible with CMemCache!
View EMemCache.php
* Presents lockingForUpdate ability to prevent dogpile effect
class EMemCache extends CMemCache
* @param $key string
* @param $timeoutSeconds int
You can’t perform that action at this time.