Skip to content

Instantly share code, notes, and snippets.

View jirutka's full-sized avatar
🇺🇦
Слава Україні!

Jakub Jirutka jirutka

🇺🇦
Слава Україні!
View GitHub Profile
@sunaot
sunaot / spock-like.rb
Last active August 29, 2015 14:07
spock ぽい何かの Ruby での習作
module Ruby
module Spock
def spec(description, definition = nil, &proc_definition)
raise ArgumentError if [ definition, proc_definition ].all? {|d| d.nil? }
if definition.nil?
spec_runner(description, proc_definition)
else
spec_runner(description, definition)
end
end
@bodiam
bodiam / asciidoc.css
Last active August 29, 2015 14:19 — forked from imjasonh/markdown.css
Render HTML as unrendered Asciidoc - See http://jsbin.com/mifepiqosa/1/edit?html,css,output
* {
font-size: 12pt;
font-family: monospace;
font-weight: normal;
font-style: normal;
text-decoration: none;
color: black;
cursor: default;
}
l={};s=m=[];i=pc=mc=0
alias p proc
h={'>':p{mc+=1},'<':p{mc-=1},'+':p{m[mc]+=1},'-':p{m[mc]-=1},'.':p{putc m[mc]}}
j={'[':->(i){s<<i;->(){pc=l[pc-1]+1 if m[mc]==0}},']':->(i){o=s.pop;l[o]=i;p{pc=o}}}
ins=DATA.each_char.map{|c|c=:"#{c}";x=(j[c]||->(_){h[c]||p{}}).(i);i+=1;x}
while k=ins[pc];pc+=1;m[mc]||=0;k.();end
__END__
[ This program prints "Hello World!" and a newline to the screen, its
length is 106 active command characters. [It is not the shortest.]
@adutra
adutra / EmbeddedMongo.java
Created June 11, 2012 17:35
Using custom StreamProcessors with Embedmongo / How to redirect mongo output to SLF4J
import java.io.IOException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.mongodb.Mongo;
import com.mongodb.MongoException;
import com.mongodb.WriteConcern;
import de.flapdoodle.embedmongo.MongoDBRuntime;
def objectproperty(func):
"""Alternate version of the standard ``@property`` decorator,
useful for proeperties that expose setter (or deleter) in addition to getter.
It allows to contain all two/three functions and prevent PEP8 warnings
about redefinion of ``x`` when using ``@x.setter`` or ``@x.deleter``.
Usage::
@mintsoft
mintsoft / change_db_owner.sh
Last active December 16, 2015 21:49 — forked from gingerlime/change_db_owner.sh
Changes the owner on all the tables in a database with support for tables with whitespace and schemata
#!/bin/bash
usage()
{
cat << EOF
usage: $0 options
This script set ownership for all table, sequence and views for a given database
Credit: Based on http://stackoverflow.com/a/2686185/305019 by Alex Soto
@anynoomcz
anynoomcz / Stručná historie přípravy systému EET.md
Last active April 8, 2016 23:33
Jak v roce 2015 probíhala příprava implementace systému EET

Stručná historie dodávky systému EET

Plány Ministerstva financí

Během roku 2015 probíhaly nezanedbatelné aktivity v oblasti EET tak, jak je MF na počátku roku předestřelo v tiskové zprávě.

Průzkum trhu

Dle uvedeného plánu SPCSS (Státní pokladna Centrum sdílených služeb) uspořádalo průzkum trhu, který byl podkladem pro zúžení skupiny oslovených potenciálních dodavatelů, kde základním kvalifikačním předpokladem byla schopnost zpracovávat nabídku a následně dodávat systém v režimu utajených informací.

FROM alpine:3.4
ENV RUST_VERSION 1.9.0
RUN apk add --no-cache 'curl'
# TODO: Verify download.
RUN curl -LOsS https://static.rust-lang.org/dist/rustc-${RUST_VERSION}-src.tar.gz \
&& ls -l \
&& tar -xzvf rustc-${RUST_VERSION}-src.tar.gz \
&& cd rustc-${RUST_VERSION}/ \
@tomvit
tomvit / XML - create xml along the xpath
Last active July 30, 2017 20:37
Create elements and/or an attribute or a text node along a path in xml.
/**
* Create elements and/or an attribute or a text node along a path in xml.
* Examples: let root be a xml element
* &lt;foo/>
*
* To create a sub-element bar with an attribute id set to a value '5':
* Node n = createXmlPath(root, "/foo/bar/@id", "5");
*
* To create a sub-element bar with a text content set to a value '7':
* Node n = createXmlPath(root, "/foo/bar/text()", "7);
@benjchristensen
benjchristensen / sync-rest-rpc.md
Last active January 15, 2018 07:24
Regarding synchronous RESTful communication ...

Response to https://twitter.com/jeffreymaxwell/status/705760483391963136 requiring more than the 77 characters left on Twitter.

DISCLAIMER: The quality of writing and thinking here is aligned with a Twitter conversation, not a blog post, presentation, or book ;-)

Synchronous RESTful communication between Microservices is an anti-pattern ... you seem to being saying that the Netflix architecture (hystrix, eureka, ribbon, ..) is broken ... hmm what would @benjchristensen say?