Skip to content

Instantly share code, notes, and snippets.

View jkbnerad's full-sized avatar

Jakub Nerad jkbnerad

View GitHub Profile
@jkbnerad
jkbnerad / git_command.md
Last active March 2, 2017 14:24
Prakticke GIT prikazy

ukecanejsi log (v jakych souborech doslo ke zmenam)

git log --stat

hodne ukecany log, hlavne tam mam autora a cas commitu (koukam do toho, kdyz se neco rozbilo a hledam vinika :-))

git config --global alias.lg 'log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit'

vysisteni netrekovanych souboru a adresaru

git clean -f -d

@jkbnerad
jkbnerad / es-topbrands.json
Last active July 8, 2016 11:32
Elasticsearch - top brands
{
"aggs": {
"nested": {
"nested": {
"path": "topBrands"
},
"aggs": {
"filtered": {
"filter": {
"term": {
'''
Buffon's Needle Experiment
Inspired by Werner Krauth, http://www.lps.ens.fr/~krauth/index.php/Main_Page
'''
import random
import math
def buffon_needle(throws, needle_length, cracks_distance):
@jkbnerad
jkbnerad / agg_rate.groovy
Created March 1, 2015 22:00
Elasticsearch - aggregations
doc['exits'].value > 0) ? doc['orders'].value / doc['exits'].value : 0
@jkbnerad
jkbnerad / HHVM vs. PHP-FPM
Last active August 29, 2015 13:58
HHVM vs. PHP-FPM
Results (nginx 1.4.1):
HHVM (3.0)
Attempts: 10
Max: 194 ms
Min: 178 ms
---------------------------------