Skip to content

Instantly share code, notes, and snippets.

View xboston's full-sized avatar

Nikolay Kirsh xboston

View GitHub Profile
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
@xboston
xboston / phalcon-ru-image.php
Last active August 19, 2016 17:28
Фоточки человеков из https://vk.com/phalconphp
<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']);
@xboston
xboston / rethinkdb-vs-mongodb-performance.py
Created September 16, 2015 13:47
rethinkdb vs mongodb performance
"""Compares rethinkdb with mongo.
"""
import copy
import pymongo
import rethinkdb as r
import time
mc = pymongo.Connection()
rc = r.connect()
location ~* ^/secure/ {
# sectoken=SUPERKEY
set $tokenheader $http_sectoken;
if ($tokenheader != "SUPERKEY") {
#add_header X-SUPERKEY $tokenheader;
return 403;
}
root /var/www/img2/images;
$di['modelsMetadata'] = function () use ($config) {
if (PH_NOCACHE) {
$cache = new \Phalcon\Mvc\Model\Metadata\Memory();
} else {
$cache = new \Phalcon\Mvc\Model\Metadata\Redis(
[
'lifetime' => 86400,
'persistent' => false,
'host' => $config->redis->host,
<?php
namespace Models\Traits {
trait Isolation
{
/**
* Поиск записей в изоляционной транзакции
*
0452c6096a2e27d07e084421eeb8e9c45be0326cfd2791803fe2240546a1193bae87af6c99cb3def759dcaf5d258853dda3005f3fd68f5491ba24c399e0346fb90
Привет, Хайп!
@xboston
xboston / noscript-tracking.go
Created May 8, 2019 10:21 — forked from wybiral/noscript-tracking.go
Tracking cursor position in real-time with remote monitoring (without JavaScript)
// Tracking cursor position in real-time without JavaScript
// Demo: https://twitter.com/davywtf/status/1124146339259002881
package main
import (
"fmt"
"net/http"
"strings"
)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Demo</title>
<meta content="width=device-width, initial-scale=1.0" name="viewport">
</head>
<body>