Skip to content

Instantly share code, notes, and snippets.

View antyblin's full-sized avatar
🦝

Pavel antyblin

🦝
  • Saint-Petersburg
View GitHub Profile

Keybase proof

I hereby claim:

  • I am antyblin on github.
  • I am antyblin (https://keybase.io/antyblin) on keybase.
  • I have a public key ASDfPKy4JfOF7ObTVz7P3jCTNFg76MRjtZTWYUTN4CC0Zgo

To claim this, I am signing this object:

@antyblin
antyblin / compare_autoincrement_values.sql
Created November 30, 2016 09:04
Compare current autoincrement value with current field value.
SELECT AUTO_INCREMENT
FROM information_schema.tables
WHERE table_name = 'tablename'
AND table_schema = DATABASE( )
UNION
SELECT max(autoincrementfield) from `tablename`
@antyblin
antyblin / download-file.sh
Last active October 25, 2016 22:15
Download webpage with assets via wget
wget --user=[user] --password=[password] -E -H -k -K -p -e robots=off [url]
@antyblin
antyblin / mysql-decode-unicode-sequences-function
Last active March 2, 2018 03:20
MySQL Function for decoding unicode escapes (original here: http://stackoverflow.com/a/11108219)
DELIMITER //
CREATE FUNCTION STRINGDECODE(str TEXT CHARSET utf8)
RETURNS text CHARSET utf8 DETERMINISTIC
BEGIN
declare pos int;
declare escape char(6) charset utf8;
declare unescape char(3) charset utf8;
set pos = locate('\\u', str);
while pos > 0 do
@antyblin
antyblin / mysql-drop-all-table-views.sql
Last active March 18, 2016 00:00
MySQL Drop all views for the table
/* DROP ALL VIEWS */
/* Taken from http://stackoverflow.com/a/22876345 */
SET @views = NULL;
SELECT GROUP_CONCAT(table_schema, '.', table_name) INTO @views
FROM information_schema.views
WHERE table_schema = @database_name; -- Your DB name here
SET @views = IFNULL(CONCAT('DROP VIEW ', @views), 'SELECT "No Views"');
PREPARE stmt FROM @views;
/*
* robotMaze.js
*
* The blue key is inside a labyrinth, and extracting
* it will not be easy.
*
* It's a good thing that you're a AI expert, or
* we would have to leave empty-handed.
*/
<?php
/**
* BaseControl Action
* @author Pavel Kotlyarov
*/
abstract class BaseControl {
private $response = array(
'errors' => array(),
'result' => null