This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class_name: AcceptanceTester | |
| modules: | |
| enabled: | |
| - Yii2 | |
| - WebDriver | |
| config: | |
| Yii2: | |
| part: [orm, fixtures, email] | |
| entryScript: index-test.php | |
| cleanup: false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 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 = { | |
| '&': '&', | |
| '<': '<', | |
| '>': '>', | |
| '\'': ''', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * 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'; | |
| * |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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 | |
| ## } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # -*- 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |