Skip to content

Instantly share code, notes, and snippets.

View shzk's full-sized avatar
👨‍💻
coding…

Denis Tokarev shzk

👨‍💻
coding…
  • Saint Petersburg, Russia
View GitHub Profile
<?php
define('BOT_TOKEN', 'XXXXXXXX:XXXXXXXXXXXXXXXXXXXXXXXX'); // place bot token of your bot here
function checkTelegramAuthorization($auth_data) {
$check_hash = $auth_data['hash'];
unset($auth_data['hash']);
$data_check_arr = [];
foreach ($auth_data as $key => $value) {
$data_check_arr[] = $key . '=' . $value;

GitHub Gist - настройка и установка в JetBrains PhpStorm

  1. Установка плагина Get Gist Beta в PhpStorm
  1. В настройках плагина вводим пароль или генерируем токен на GitHub

P.S. К сожалению в Windows плагин работает не корректно c кодировкой Win-1251. Проблема до сих пор актуальна.

@shzk
shzk / ALTERNATIVES.adoc
Created April 15, 2020 14:48 — forked from mbbx6spp/ALTERNATIVES.adoc
Super quick list of alternatives to Jira and/or Confluence, Stash, Crucible, etc.
@shzk
shzk / gist:addaf2a785ced2336a4288358a4d3396
Created November 17, 2018 15:58 — forked from quoidautre/gist:3781733
PHP: PDO snippets
// PDO Connection to MySQL
$conn = new PDO('mysql:host=localhost;dbname=yourdbname', 'username', 'password');
// PDO Connection to PostgreSQL
$conn = new PDO('pgsql:host=localhost;dbname=yourdbname', 'username', 'password');
// A quick Select Query with For Loop
foreach ($conn->query("SELECT * FROM profile") as $row)
echo $row['fullname'];
@shzk
shzk / GIT Deploy.md
Last active August 31, 2018 18:26 — forked from nichtich/README.md
How to automatically deploy from GitHub

Deploy your site with git

This gist assumes:

  • you have an online remote repository (github / bitbucket etc.)
  • you have a local git repo
  • and a cloud server (Rackspace cloud / Amazon EC2 etc)
    • your (PHP) scripts are served from /var/www/html/
    • your webpages are executed by Apache
  • the Apache user is named www-data (may be apache on other systems)
@shzk
shzk / functions.php
Created July 3, 2018 08:06 — forked from jameskoster/functions.php
WooCommerce - set image dimensions upon theme activation
<?php
/**
* Hook in on activation
*/
/**
* Define image sizes
*/
function yourtheme_woocommerce_image_dimensions() {
global $pagenow;
var gulp = require('gulp');
var clean = require('gulp-clean');
var jshint = require('gulp-jshint');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var imagemin = require('gulp-imagemin');
var bases = {
app: 'app/',
@shzk
shzk / gulpfile.js
Created December 23, 2017 20:21 — forked from klugjo/gulpfile.js
Basic gulpfile.js for a static website (HTML copy and CSS concatenation)
// Add our dependencies
var gulp = require('gulp'), // Main Gulp module
concat = require('gulp-concat'); // Gulp File concatenation plugin
// Configuration
var configuration = {
paths: {
src: {
html: './src/*.html',