Skip to content

Instantly share code, notes, and snippets.

View bethrezen's full-sized avatar
🎯
Focusing

Alexander Kozhevnikov bethrezen

🎯
Focusing
View GitHub Profile
@bethrezen
bethrezen / ffmpeg-benchmarks.md
Last active January 31, 2025 10:28
Little GPU ffmpeg NVENC encoding benchmarks
package main
import (
"fmt"
"github.com/blevesearch/bleve"
"github.com/blevesearch/bleve/analysis"
_ "github.com/blevesearch/bleve/analysis/analyzer/custom"
_ "github.com/blevesearch/bleve/analysis/analyzer/standard"
_ "github.com/blevesearch/bleve/analysis/char/zerowidthnonjoiner"
_ "github.com/blevesearch/bleve/analysis/lang/en"
DROP PROCEDURE IF EXISTS getpath;
DELIMITER $$
CREATE PROCEDURE getpath(IN cat_id INT, OUT path TEXT)
BEGIN
DECLARE catname VARCHAR(80);
DECLARE temppath TEXT;
DECLARE tempparent INT;
SET max_sp_recursion_depth = 255;
SELECT slug, parent_id FROM category WHERE id=cat_id INTO catname, tempparent;
IF tempparent =0
class_name: AcceptanceTester
modules:
enabled:
- Yii2
- WebDriver
config:
Yii2:
part: [orm, fixtures, email]
entryScript: index-test.php
cleanup: false
@bethrezen
bethrezen / install.sh
Created June 23, 2017 09:41 — forked from NLKNguyen/install.sh
Install Hadoop on Ubuntu 16.04
# Copy line by line and paste to an interactive shell
# Update system
sudo apt-get update && sudo apt-get dist-upgrade
# Install Java
sudo add-apt-repository ppa:openjdk-r/ppa
sudo apt-get update
sudo apt-get install openjdk-7-jdk
@bethrezen
bethrezen / es6-html-escape-template-tag.js
Created May 21, 2017 10:09
es6 template tag for html escaping
// HTML Escape helper utility
const util = (function () {
// Thanks to Andrea Giammarchi
const reEscape = /[&<>'"]/g;
const reUnescape = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34);/g;
const oEscape = {
'&': '&amp;',
'<': '&lt;',
'>': '&gt;',
'\'': '&#39;',
@bethrezen
bethrezen / es6-jquery-plugin.js
Last active May 23, 2017 13:29
ES6-style jQuery plugin definition
/**
* Generate a jQuery plugin
* Based on https://gist.github.com/monkeymonk/c08cb040431f89f99928132ca221d647
* @param pluginName [string] Plugin name
* @param ClassName [object] Class of the plugin
* @param shortHand [bool] Generate a shorthand as $.pluginName
*
* @example
* import plugin from 'plugin';
*
#!/bin/bash
## configuration {
BACKUP_DIR="ABSOLUTE_PATH_TO_BACKUP_DIR"
DBNAME="UR_DB_NAME"
DBUSER="UR_DB_USER"
DBPASSWD="UR_DB_PASSWORD"
DATE_TEMPLATE="$(date '+%Y.%m.%d_at_%H-%M')"
DAYS_TO_STORE=30
## }
@bethrezen
bethrezen / Vagrantfile
Last active June 6, 2021 04:56
Vagrantfile for latest php7 and memcached
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure(2) do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
@bethrezen
bethrezen / abtest.conf.lua
Created October 2, 2012 08:01
Nginx A/B test config
set $target '';
access_by_lua '
local abtest = 0
local abtestMax = 1
local userAgent = ngx.req.get_headers()["User-Agent"]
local cookie = ngx.var.cookie_abtest
if ngx.re.match(userAgent, "(yandex|google|MSIE|bot)", "i") then
cookie = 0