This file contains 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
location ~* ^/secure/ { | |
# sectoken=SUPERKEY | |
set $tokenheader $http_sectoken; | |
if ($tokenheader != "SUPERKEY") { | |
#add_header X-SUPERKEY $tokenheader; | |
return 403; | |
} | |
root /var/www/img2/images; |
This file contains 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
"""Compares rethinkdb with mongo. | |
""" | |
import copy | |
import pymongo | |
import rethinkdb as r | |
import time | |
mc = pymongo.Connection() | |
rc = r.connect() |
This file contains 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
<div style="text-align: center"> | |
<?php | |
// 45934290 - ID группы | |
$d = file_get_contents("https://api.vk.com/method/groups.getMembers?group_id=45934290&v=5.16&offset=0&count=1000&fields=photo_50"); | |
$us= json_decode($d,true); | |
foreach($us['response']['items'] as $u){ | |
echo sprintf('<img src="%s"/>',$u['photo_50']); |
This file contains 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
app: # https://github.com/tutumcloud/tutum-docker-php | |
image: tutum/apache-php:latest | |
links: | |
- mysql:db | |
- mogilefs:mogilefs | |
- elasticsearch:elasticsearch | |
- redis:redis | |
- rabbitmq:rabbitmq | |
ports: | |
- 80:80 |
This file contains 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
{ | |
"size": 0, | |
"query": { | |
"simple_query_string": { | |
"query": "найди это", | |
"fields": [ | |
"title", | |
"domain", | |
"description", | |
"keywords", |
This file contains 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
# Для проброса интерфейса Mailcatcher из Vagrant к пользователю | |
# | |
server { | |
listen 80; | |
server_name mailcatcher.loc www.mailcatcher.loc; | |
location / { | |
proxy_pass http://127.0.0.1:1080; | |
} |
This file contains 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
// PRIVATE очеловечиваем ссылки на медиа-файлы | |
this._parseMedia = function(){ | |
var _img_class = ''; | |
// подсвечиваем все ссылки | |
$message = $('#chat_body div:last .message'); | |
$message.html( ' '+$message.html()+' ' ); | |
$message.html($message.html().replace(/(\s|^)(https?:\/\/\S+)/gi,"$1<a href=\"$2\" target=\"_blank\">$2</a>")); | |
// определяем расширение куда ведут ссылки в сообщении |
This file contains 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
// для ссылок ведущих на изображение выводим превью | |
$('#chat_body div:last span.message a:regex(data:extension, png|jpg|jpeg|gif)').each(function() { | |
_img_class = this.href.indexOf('images/smiles')>0 ? '':'images_from_message'; | |
$(this).html($('<img/>').attr('src',this.href).attr('class', _img_class)); | |
_img_class = ''; | |
}); |
This file contains 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
<?php | |
/** | |
Регистрация сервиса представлений | |
$di['widgetRender'] = function () use ($di) { | |
$view = new Phalcon\Mvc\View\Simple(); | |
$view->setViewsDir(APPLICATION_ROOT . '/Views/Widgets/'); |