Skip to content

Instantly share code, notes, and snippets.

@TigerWhite
TigerWhite / add-city.txt
Created March 6, 2020 03:08 — forked from chernyhmihail/add-city.txt
Подключение подбора города
<div class="confirm-add-city">
<label for="city">Город:</label><br>
<input type="text" id="city" style="display: none;" placeholder="Введите название населенного пункта">
<div class="confirm-city-block">
<span class="confirm-city">Москва</span>
<a href="#!" class="confirm-city__edid">изменить</a>
</div>
</div>
<script src="http://api-maps.yandex.ru/2.1/?lang=ru_RU" type="text/javascript"></script>
@TigerWhite
TigerWhite / nginx-ps-config
Created November 10, 2019 20:39 — forked from ASergey/nginx-ps-config
Example prestashop 1.6 nginx host config
server {
listen 80;
server_name maxmobiles.lo *.maxmobiles.lo;
root /var/www/maxmobiles.lo;
error_log /var/www/maxmobiles.lo/log/error.log warn;
location / {
index index.html index.php; ## Allow a static html file to be shown first
@TigerWhite
TigerWhite / git-deployment.md
Created April 2, 2019 18:36 — forked from noelboss/git-deployment.md
Simple automated GIT Deployment using Hooks

Simple automated GIT Deployment using GIT Hooks

Here are the simple steps needed to create a deployment from your local GIT repository to a server based on this in-depth tutorial.

How it works

You are developing in a working-copy on your local machine, lets say on the master branch. Most of the time, people would push code to a remote server like github.com or gitlab.com and pull or export it to a production server. Or you use a service like deepl.io to act upon a Web-Hook that's triggered that service.

@TigerWhite
TigerWhite / !Как установить сфинкс.md
Created May 11, 2018 10:58 — forked from codedokode/!Как установить сфинкс.md
Как установить и настроить сфинкс.

Как установить и настроить сфинкс.

Скачиваем сфинкс (берем версию с MySQL и со стеммингом на 15 языков Win32 binaries w/MySQL+PgSQL+libstemmer+id64 support соответствующую битности твоей ОС), распаковываем например в d:\temp\s\

На этом установка sphinx завершена. В дебиане просто делаем sudo apt-get install sphinxsearch.

Создаем таблицы:

CREATE TABLE news 

(id INT(10) AUTO_INCREMENT PRIMARY KEY, topic INT(10) NOT NULL, header VARCHAR(200) NOT NULL,

@TigerWhite
TigerWhite / stylesheet-injector.js
Created January 23, 2018 14:24 — forked from necolas/stylesheet-injector.js
Create and append style sheets to document <head> using JavaScript
(function() {
var css = [
'/css/default.css',
'/css/section.css',
'/css/custom.css'
],
i = 0,
link = document.createElement('link'),
head = document.getElementsByTagName('head')[0],
tmp;
// Add Rules to Stylesheets with JavaScript
// http://davidwalsh.name/add-rules-stylesheets
/* Getting the Stylesheet
Which stylesheet you add the rules to is up to you. If you have a specific stylesheet in mind, you can add an ID to the LINK or STYLE element within your page HTML and get the CSSStyleSheet object by referencing the element's sheet property. The stylesheets can be found in the document.styleSheets object:*/
var sheets = document.styleSheets; // returns an Array-like StyleSheetList
/*
Returns:
@TigerWhite
TigerWhite / git-hosting-apache.conf
Created April 5, 2017 14:32 — forked from karmi/git-hosting-apache.conf
Configuration for hosting Git repositories with Apache 2.x
# ----------------------------------------------------------
# Configuration for hosting Git repositories with Apache 2.x
# ----------------------------------------------------------
#
# This setup provides "dual URLS", where URL like <http://git.example.com/my_repository.git>
# loads Gitweb in the browser and the same URL can be used in commands like `git clone` and `git remote add`.
# It was compiled from some sources on the internet and further customized/tuned.
#
# Please see documentation for:
#
@TigerWhite
TigerWhite / .htaccess
Created April 5, 2017 14:31 — forked from qbbr/.htaccess
.htaccess for Apache 2
# .htaccess
#
# https://gist.github.com/897822
# Sokolov Innokenty, <sokolov.innokenty@gmail.com>
# in php.ini:
# disable_functions "exec,passthru,shell_exec,system,proc_open,popen,curl_exec,curl_multi_exec,parse_ini_file,show_source"
DirectoryIndex index.php
@TigerWhite
TigerWhite / import.py
Created October 10, 2016 17:01
Пример python-скрипта для импорта пользователей в Carrotquest (зная User ID). Документация: https://carrotquest.io/developers/endpoints/users/props/
import requests
import json
# Список пользователей, которых нужно импортировать
# Первый элемент - User ID, второй - емейл
users = [
(123, 'mail1@mail.ru'),
(456, 'mail2@mail.ru'),
]
SET FOREIGN_KEY_CHECKS=0;
DROP TABLE IF EXISTS `newpresta17`.`ps_accessory` ;
DROP TABLE IF EXISTS `newpresta17`.`ps_address` ;
DROP TABLE IF EXISTS `newpresta17`.`ps_address_format` ;
DROP TABLE IF EXISTS `newpresta17`.`ps_alias` ;
DROP TABLE IF EXISTS `newpresta17`.`ps_attachment` ;
DROP TABLE IF EXISTS `newpresta17`.`ps_attachment_lang` ;
DROP TABLE IF EXISTS `newpresta17`.`ps_attribute` ;