This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Demo{ | |
fun createInvoice(alias: String) { | |
val racunZahtjev = RacunZahtjev() | |
val id = "20d30b94-7da0-4c50-976d-bac6ab1f639a" | |
racunZahtjev.id = id | |
val idPoruke = UUID.randomUUID().toString() | |
val datumVrijeme = "24.01.2020T09:59:43" | |
racunZahtjev.zaglavlje = ZaglavljeType().also { | |
it.idPoruke = idPoruke |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var fs = require("fs") | |
var text = fs.readFileSync("./data.txt") | |
.toString() | |
.toLowerCase() | |
.replace(/[^\w\s]/gi, '') | |
.split("\n") | |
var parsed = {} | |
// in production I would devide this part into countWords function |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
chrome.extension.onRequest.addListener(function (request, sender, sendResponse) { | |
if (request.greeting == "scan") { | |
const videos = document.getElementsByTagName('video') | |
const sources = document.getElementsByTagName('source') | |
//console.log('sources', sources) | |
//console.log('videos', videos) | |
const list = [] | |
for (let i = 0; i < Object.keys(videos).length; i++) { | |
list.push(videos[i].src.replace('mime=true', '')) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function init() { | |
chrome.tabs.getSelected(null, (tab) => { | |
chrome.tabs.sendRequest(tab.id, { greeting: "scan", id: tab.id }, function (response) { | |
var node = document.createElement("div"); | |
if (response instanceof Array) { | |
response.forEach(element => { | |
var div = document.createElement("div"); | |
div.innerHTML = `<a href='${element}' download="video">${element}</a>`; | |
node.appendChild(div); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"manifest_version": 2, | |
"name": "My Extension", | |
"version": "1", | |
"permissions": [ | |
"activeTab", | |
"storage" | |
], | |
"icons": { | |
"128": "./icon.png" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<body style="width: 300px"> | |
<script type="text/javascript" src="./popup.js"></script> | |
<div id='container'></div> | |
</body> | |
</html> |