Skip to content

Instantly share code, notes, and snippets.

View tsvetomir's full-sized avatar

Tsvetomir Tsonev tsvetomir

View GitHub Profile
@tsvetomir
tsvetomir / run-outside-zone.js
Last active July 31, 2017 12:28
runOutsideZone
const symbol = Zone["__symbol__"]("setTimeout")
const plainTimeout = window[symbol];
export const runOutsideZone =
(fn, delay) => plainTimeout(fn, delay);
@tsvetomir
tsvetomir / index.js
Last active August 19, 2020 16:08
Kendo UI file save proxy (Express)
const express = require('express');
const bodyParser = require('body-parser');
const app = express();
const port = 7569;
app.use(bodyParser.urlencoded({ extended: false }));
app.post('/', (req, res) => {
const { fileName, contentType, base64 } = req.body;
const content = Buffer.from(base64, 'base64');
@tsvetomir
tsvetomir / copy-markup.html
Last active June 3, 2021 10:27
Copy markup
<button onclick="copyMarkup()">Copy source!</button>
<script>
function copyMarkup() {
const box = document.createElement('textarea');
box.style.position = 'absolute';
box.style.left = '-10000px';
box.setAttribute('cols', '1000');
document.body.appendChild(box);
box.value = document.documentElement.innerHTML;