Skip to content

Instantly share code, notes, and snippets.

View kovacshuni's full-sized avatar

Hunor Kovács kovacshuni

View GitHub Profile
@kovacshuni
kovacshuni / response.txt
Created May 25, 2016 14:47
notifications-push-documentation
data: []
data: []
data: []
data: [{"apiUrl":"http://api.ft.com/content/7998974a-1e97-11e6-b286-cddde55ca122","id":"http://www.ft.com/thing/7998974a-1e97-11e6-b286-cddde55ca122","type":"http://www.ft.com/thing/ThingChangeType/UPDATE"}]
data: []
@kovacshuni
kovacshuni / fleetctl-shortcuts
Created August 3, 2016 11:33 — forked from tamas-molnar/fleetctl-shortcuts
aliases and shortcuts
alias fc='fleetctl'
alias fclm='fleetctl list-machines'
alias fclu='fleetctl list-units'
alias fcjf='fleetctl journal -f '
alias fcbad='fleetctl list-units | grep -v "exited\|running\|backup\|upgrade"'
function fclmg() { fleetctl list-machines | grep $@ ;}
function fclug() { fleetctl list-units | grep $@ ;}
function fcssh() { fleetctl ssh $@ ;}
function fcjfl() { fleetctl journal -f --lines=$@ ; }
@kovacshuni
kovacshuni / enriched-response.json
Last active August 9, 2016 11:12
videos-first-class
{
"id": "http://www.ft.com/thing/5123c256-760f-3f29-a9da-6a3437698f17",
"bodyXML": "<body>test helloo again and again and</body>",
"publishedDate": "2016-08-03T10:12:02.380Z",
"requestUrl": "http://xp-up-read.ft.com/enrichedcontent/5123c256-760f-3f29-a9da-6a3437698f17",
"brands": [
"http://api.ft.com/things/dbb0bdae-1f0c-11e4-b0cb-b2227cce2b54"
],
"apiUrl": "http://xp-up-read.ft.com/enrichedcontent/5123c256-760f-3f29-a9da-6a3437698f17",
"types": [
@kovacshuni
kovacshuni / keybase.md
Created January 11, 2017 14:37
keybase.md

Keybase proof

I hereby claim:

  • I am kovacshuni on github.
  • I am kovacshuni (https://keybase.io/kovacshuni) on keybase.
  • I have a public key whose fingerprint is CD73 1BC4 48A4 3C60 32DB 2194 7266 0A64 2CD1 D6FA

To claim this, I am signing this object:

@kovacshuni
kovacshuni / Future-vs-CompletionStage.md
Created February 13, 2017 18:02
Future-vs-CompletionStage

Future -> CompletionStage

  1. map -> thenApply
  2. flatMap -> thenCompose
  3. forEach -> thenAccept
@kovacshuni
kovacshuni / simple.c
Created March 1, 2017 14:23
kill-daemon-process-test
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
int main(int argc, char **argv) {
printf("Hello from the parent process!\n");
pid_t pid = fork();
if (pid == -1) {
perror("fork failed");
exit(-1);
@kovacshuni
kovacshuni / hightlighting-tid
Created March 15, 2017 16:54
hightlighting-tid
'notifications-monitor':
'patterns': [
{
'match': '^(tid_.*) ()'
'name': 'keyword.tid'
}
]
@kovacshuni
kovacshuni / scala-akka-streams-concurrent-requests.scala
Last active March 22, 2017 17:07
scala-akka-streams-concurrent-requests
Source(List("/", "/docs"))
.map(theUri => HttpRequest(uri = theUri))
.via(Http().outgoingConnection("akka.io").async)
.mapAsyncUnordered(2)(r => r.entity.toStrict(2 seconds))
.map(e => e.data.utf8String)
.fold(List[String]())(_ :+ _)
.runWith(Sink.head)
.onComplete(logger.info("{}", _))
type SomeResource struct {
counter int
}
func (sr *SomeResource) incCounter(rw http.ResponseWriter, r *http.Request) {
sr.counter++
}
func (sr *SomeResource) getCounter(rw http.ResponseWriter, r *http.Request) {
v := strconv.Itoa(sr.counter)
{"attributes":"\u003c?xml version=\"1.0\" encoding=\"UTF-8\"?\u003e\n\u003c!DOCTYPE ObjectMetadata SYSTEM \"/SysConfig/Classify/FTStories/classify.dtd\"\u003e\u003cObjectMetadata\u003e\n \u003cEditorialDisplayIndexing\u003e\n \u003cDILeadCompanies/\u003e\n \u003cDITemporaryCompanies\u003e\n \u003cDITemporaryCompany\u003e\n \u003cDICoTempCode/\u003e\n \u003cDICoTempDescriptor/\u003e\n \u003cDICoTickerCode/\u003e\n \u003c/DITemporaryCompany\u003e\n \u003c/DITemporaryCompanies\u003e\n \u003cDIFTSEGlobalClassifications/\u003e\n \u003cDIStockExchangeIndices/\u003e\n \u003cDIHotTopics/\u003e\n \u003cDIHeadlineCopy\u003eBarclays shares climb as Exane sees good news in history\u003c/DIHeadlineCopy\u003e\n \u003cDIBylineCopy\u003eBryce Elder\u003c/DIBylineCopy\u003e\n \u003cDIFTNPSections/\u003e\n \n \n \u003cDIFirstParCopy\u003eUK stocks slip to their worst weekly perfo