Skip to content

Instantly share code, notes, and snippets.

View plindberg's full-sized avatar

Peter Lindberg plindberg

View GitHub Profile
@plindberg
plindberg / dump-watson-dialog-conversation-history.sh
Last active June 21, 2016 17:26
Quick and dirty dump of Watson Dialog conversation history (using httpie and jq)
http -b -a ${WATSON_DIALOG_USERNAME}:${WATSON_DIALOG_PASSWORD} \
https://gateway.watsonplatform.net/dialog/api/v1/dialogs/${WATSON_DIALOG_ID}/conversation\
\?date_from='2016-01-27 00:00:00'\&date_to='2016-06-22 00:00:00' \
|jq '
.conversations[] | .messages |
[
.[] |
if .from_client == "true" then
"> \(.text)"
else
'use strict';
const co = require('co');
// Like `reduce()` but accepting a generator function, such that it can be used asynchronously
// within a generator function invoked by `co()`.
function* reduceg(arr, genfn, initial) {
let acc = initial;
for (let x of arr) {
acc = yield genfn(acc, x);
@plindberg
plindberg / ibm-watson-dialog-capture-anything.xml
Created May 28, 2016 08:57
Capture anything using IBM Watson Dialog.
<?xml version="1.0" encoding="UTF-8" ?>
<dialog xsi:noNamespaceSchemaLocation="WatsonDialogDocument_1.0.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<flow>
<folder label="Main">
<output>
<prompt>
<item>Write stuff and I’ll echo it back to you.</item>
</prompt>

Keybase proof

I hereby claim:

  • I am plindberg on github.
  • I am plindberg (https://keybase.io/plindberg) on keybase.
  • I have a public key whose fingerprint is 8D96 0967 F08E 6C08 AA59 86B5 B4A3 4502 1F51 E914

To claim this, I am signing this object:

_ ___ __ __ ____ ____ _
| | / (_)_ _ ___ ___ ___/ / / |/ (_)__________ / __/__ _____ __(_)______
| |/ / / ' \/ _ \/ _ \/ _ / / /|_/ / / __/ __/ _ \ _\ \/ -_) __/ |/ / / __/ -_)
|___/_/_/_/_/\___/_//_/\_,_/ /_/ /_/_/\__/_/ \___/ /___/\__/_/ |___/_/\__/\__/
@plindberg
plindberg / gist:4734157
Created February 7, 2013 21:04
Fleecelabs 24 frågor

Vad skulle få er att tacka nej till ett potentiellt uppdrag? (Uppdraget i sig, inte uppdragsgivaren specifikt.)

Finns det några uppdragsgivare ni inte skulle vilja jobba för? (Kanske tobaksbolag, vapenindustri, spelföretag osv.)

Vilka råd skulle ni ge en utvecklare i början av sin karriär som konsult?

Finns det någon uppdragsgivare ni önskar ni fick jobba för? (Antingen specifik eller typ.)

Hur skulle ni beskriva ett lyckat uppdrag? Hur skulle projektet se ut? Hur skulle uppdragsgivarens och era roller se ut?

@plindberg
plindberg / dabblet.css
Created August 12, 2012 17:06
#p –> .program-page
/*
#p –> .program-page
#m –> .program-main
#mi –> .program-main-inner
#as –> .program-asides
#a1 –> .program-aside-1
#ai1 –> .program-aside-1-inner
@plindberg
plindberg / dabblet.css
Created August 12, 2012 17:11
Untitled
#p {
display: inline-block;
}
#p:after {
display: table;
clear: both;
content: '';
}
#mi {
#w {
letter-spacing: -0.31em;
word-spacing: -0.43em;
*letter-spacing: normal;
margin-top: 60px
}
#m, #a1, #a2 {
letter-spacing: normal;
@plindberg
plindberg / dabblet.css
Created June 30, 2012 20:48
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
span {
font: 0/0 a;
text-shadow: none;
color: transparent;
}