Skip to content

Instantly share code, notes, and snippets.

@bojanbjelic
bojanbjelic / rss-dl-mp3.sh
Created November 19, 2012 23:35
download mp3s from a rss feed
wget [RSS URL]
grep -e '[^"]*\.mp3' [downloaded RSS] | grep -o '[^"]*\.mp3' '-' >> list.txt
wget -i list.txt
@bojanbjelic
bojanbjelic / xml2json.xsl
Created January 18, 2012 11:24
XML to JSON
<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text" encoding="utf-8"/>
<xsl:template match="/node()">
<xsl:text>{</xsl:text>
<xsl:apply-templates select="." mode="detect" />
<xsl:text>}</xsl:text>
</xsl:template>
@bojanbjelic
bojanbjelic / gist:b3058ea8c1344c57bcd54705c58894fb
Last active May 12, 2019 07:25 — forked from SzymonPobiega/gist:5220595
DDD/CQRS/ES/Architecture videos

If you have two days to learn the very basics of modelling, Domain-Driven Design, CQRS and Event Sourcing, here's what you should do:

In the evenings read the Domain-Driven Design Quickly Minibook https://www.infoq.com/minibooks/domain-driven-design-quickly. During the day watch following great videos (in this order):

  1. Eric Evans' What I've learned about DDD since the book https://www.infoq.com/presentations/ddd-eric-evans  https://youtu.be/lE6Hxz4yomA
  2. Eric Evans' [Strategic Design - Responsibility Traps]{http://www.infoq.com/presentations/design-strategic-eric-evans}
  3. Udi Dahan's [Avoid a Failed SOA: Business & Autonomous Components to the Rescue]{http://www.infoq.com/presentations/SOA-Business-Autonomous-Components}
  4. Udi Dahan's [Command-Query Responsibility Segregation]{http://www.infoq.com/presentations/Command-Query-Responsibility-Segregation}
  5. Greg Young's [Unshackle Your Domain]{http://www.infoq.com/presentations/greg-young-unshackle-qcon08}
@bojanbjelic
bojanbjelic / curl-soap.cmd
Last active May 12, 2019 07:25
curl a SOAP service
curl "https://www.example.com/Service.svc" -H "SOAPAction: ""urn:service.example.com/IService/GetObject""" --data-binary @post.txt --comcodessed -k -D responseHeaders.txt -v -o response.txt
@bojanbjelic
bojanbjelic / selectElementsFromAjaxResponse.js
Last active June 18, 2018 10:58
Selecting Elements Returned From Jquery Ajax Response Strings
$(function () {
$.get('contentUrl', function (response) {
var source = $('<div>' + response + '</div>');
$('#target').empty().append(
$('<div/>')
.append(response)
.find('#selectorInResult');
);
});
});
%AppData%\..\Local\Programs\Python\Python35-32\Scripts\pip.exe install jsonschema
py -m pip install svglib
@bojanbjelic
bojanbjelic / spider-urls.sh
Created February 14, 2013 10:37
spider unique URLs on pages, starting from one URL
wget --spider --force-html -r -l1 http://tigar.ir.ttweb.net/ 2>&1 | grep '^--' | awk '{ print $3 }' | grep -v '\.\(css\|txt\|png\|gif\|jpg\|js\)$' | sort --unique
@bojanbjelic
bojanbjelic / img2ascii.js
Created April 9, 2015 08:20
convert image to ascii
// taken from http://thecodeplayer.com/walkthrough/cool-ascii-animation-using-an-image-sprite-canvas-and-javascript
//some variables
var r, g, b, gray;
var character, line = "";
//sprite stuff
var sprite = document.getElementById("sprite");
var W = sprite.width;
var H = sprite.height;
@bojanbjelic
bojanbjelic / cassinikill.cmd
Created December 10, 2013 15:57
Cassini kill
taskkill /IM WebDev.WebServer40.exe /F