Skip to content

Instantly share code, notes, and snippets.

View misablaha's full-sized avatar

Michal Blaha misablaha

View GitHub Profile
; Sample supervisor config file.
[unix_http_server]
file=/tmp/supervisor.sock ; (the path to the socket file)
chmod=0777 ; sockef file mode (default 0700)
;chown=nobody:nogroup ; socket file uid:gid owner
;username=user ; (default is no username (open server))
;password=123 ; (default is no password (open server))
[inet_http_server] ; inet (TCP) server disabled by default
@misablaha
misablaha / err.coffee
Last active December 23, 2015 17:29 — forked from falsecz/err.coffee
$ = (next, success) => (err) =>
return next err if err
args = Array::slice.call arguments, 1
success.apply success, args
express = require 'express'
fs = require 'fs'
<?php
namespace Sbks\Stdlib;
/**
* Class ArrayMapper
* @package Sbks\Stdlib
*/
class ArrayMapper
{
# the oldest first - 1. page
SELECT id, time FROM comment
WHERE post_id = "70630972354_10151984553982355"
ORDER BY time ASC
LIMIT 5
>>>
{
@misablaha
misablaha / daily_offset_data.js
Last active December 19, 2015 18:29
Struktura agregovanych dat
// struktura dokumentu se da prealokovat jiz pri zakladani
// ... dokumenty bude nutne zakladat zvlastnim scriptem mimo aggregatory
// ... pri zakladani primo v aggregatoru bysme museli overovat existenci dokumentu
// co kdyz se page prestane v nejakem offsetu pocitat?
// ... nechame ho tam
// !!!! pri zmene offsetu v timezone bude pro frontend potreba cist 4 dokumenty misto standardnich 2 !!!!
// ... data se budou cist najednou {"_id": {"$in": ["99991509734#201306T-04", "99991509734#201306T-05"]}
// ... dvakret se bude nacitat jen mesic, ve kterem se meni cas - tedy ne 4, ale 3 dokumenty
@misablaha
misablaha / gist:5908262
Last active December 19, 2015 05:59
Stats document format
/*
* Resources
*
* R: real data
* I: insights data
* L: linear interpolation
*
* U: used resource
*/
<?php
class Serializer
{
/**
* Vstupni pole musi obsahovat
* - pouze celociselne hodnoty
* - pro oznaceni klicu pismena a-f
*
@misablaha
misablaha / gist:3916864
Created October 19, 2012 08:06 — forked from falsecz/gist:3912460
dapiClient
dapiClient = require 'dapi-client'
# application announce to API
app = dapiClient '10.11.1.173:5558'
# require metody API
# bude nahlaseno na API jako dependecy
# po startu aplikace neni mozne requirovat dalsi API metody
@misablaha
misablaha / gist:3164125
Created July 23, 2012 15:04
json_validate
validate = require('./node_modules/commonjs-utils/lib/json-schema.js').validate
schema =
type: "object"
properties:
users:
type: "object"
items:
type: "object"
properties: