Skip to content

Instantly share code, notes, and snippets.

View michalstocki's full-sized avatar

Michał Stocki michalstocki

View GitHub Profile
@michalstocki
michalstocki / my-map.kml
Last active January 18, 2018 22:11
My map
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
<Document>
<name>Dworki i Pałace</name>
<description/>
<Style id="icon-1899-DB4436-normal">
<IconStyle>
<color>ff3644db</color>
<scale>1</scale>
<Icon>
@michalstocki
michalstocki / removeCharsAtIndexes.ts
Last active January 17, 2017 14:14
Remove from string chars at indexes
export function removeCharsAtIndexes(inputString:string, indexes:number[]):string {
return indexes.reduce((sourceString:string, indexToRemove:number, currentIndex:number) => {
return sourceString.slice(0, indexToRemove - currentIndex) + sourceString.slice(indexToRemove - currentIndex + 1);
}, inputString);
}
@michalstocki
michalstocki / index.html
Last active February 4, 2016 23:25
Service Worker CORS Test
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Service Worker Test</title>
</head>
<body>
<headset>
<h1>Test of registering service worker</h1>
@michalstocki
michalstocki / timer.js
Last active December 24, 2015 02:09
Simple 'setTimeout' wrapper which acts as player
function Timer(callback, delay) {
var timerId, start, remaining = delay, going = false;
var _callback = function() {
callback();
remaining = delay;
going = false;
};
this.wait = function() {