Skip to content

Instantly share code, notes, and snippets.

View atme's full-sized avatar
🏠
Working from home

Serge Pirogov atme

🏠
Working from home
  • Berlin, Germany
  • 04:56 (UTC +02:00)
View GitHub Profile
error_reporting(E_ALL);
ini_set('display_errors', 1);
<?php ob_start(); ?>
<!--content-->
<?='<span class="replace" data-block-id="' . base64_encode(ob_get_clean()) . '"></span>'?>
jQuery(".replace2").each(function () {
var hash = jQuery(this).attr("data-block-id");
jQuery(this).replaceWith(jQuery.base64.atob(hash, true));
});
@atme
atme / seo table
Last active August 29, 2015 14:21
ALTER TABLE some_table ADD(
`created` bigint(11) NOT NULL,
`author` int(11) NOT NULL,
`last_author` int(11) NOT NULL,
`last_edit` bigint(11) NOT NULL,
`seo_index` tinyint(1) NOT NULL DEFAULT '1',
`seo_title` varchar(256) NOT NULL,
`seo_h1` varchar(256) NOT NULL,
`seo_description` varchar(512) NOT NULL,
`seo_keywords` varchar(512) NOT NULL,
@atme
atme / csgolounge-autobump.user.js
Created April 22, 2015 09:10
Autobump for csgolounge.com
// ==UserScript==
// @name csgolounge-autobump
// @namespace csgoloungeAutobump
// @include http://csgolounge.com/mytrades
// @version 1
// @grant none
// ==/UserScript==
/*global $, console*/
(function ($) {
@atme
atme / gist:8501e2cfe5852871c5da
Created September 24, 2014 12:37
vagrant windows
chcp 1251
$qMarks = str_repeat('?,', count($articles) - 1) . '?';
@atme
atme / Запрос на проверку пустых article_replaced
Last active August 29, 2015 14:05
Запрос находит записи с article_replaced is null, у которых нет записей с таким же артикулом, но заполненным полем.
SELECT an.article, ano.article
FROM atr_nomenclature an
LEFT OUTER JOIN atr_nomenclature ano ON an.article = ano.article AND ano.deleted = '0' AND ano.article_replaced is not null
WHERE an.deleted = '0' AND an.article_replaced is null AND an.article is not null AND ano.article is null