Skip to content

Instantly share code, notes, and snippets.

@vologab
vologab / .js
Created October 18, 2019 07:50
JS array flatten polyfill
const assert = require('assert');
function flatten(a) {
if (!Array.isArray(a)) throw new Error('Input value should be array');
let stack = JSON.parse(JSON.stringify(a))
let result = [];
while (stack.length) {
let a = stack.pop();
if (Array.isArray(a)) {
stack.push(...a);
@vologab
vologab / hero.ts
Created April 7, 2017 08:28 — forked from brennanMKE/hero.ts
Example of Mongoose with TypeScript and MongoDb
import * as mongoose from 'mongoose';
export let Schema = mongoose.Schema;
export let ObjectId = mongoose.Schema.Types.ObjectId;
export let Mixed = mongoose.Schema.Types.Mixed;
export interface IHeroModel extends mongoose.Document {
name: string;
power: string;
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!-- saved from url=(0072)http://konfitu.re/decathlon/emailing/2016-12-rappel-produit/RU/mail.html -->
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0;">
<meta name="format-detection" content="telephone=no">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title></title>
<style type="text/css">
.ReadMsgBody {
HTTP Status 500 - Request processing failed; nested exception is java.lang.RuntimeException: Broken Connection or Error during Connection: Server returned HTTP response code: 503 for URL: https://legacyorigin-rtv2-production.rottentomatoes.com/api/private/v1.0/wordpress/header?country=RU java.io.IOException: Server returned HTTP response code: 503 for URL: https://legacyorigin-rtv2-production.rottentomatoes.com/api/private/v1.0/wordpress/header?country=RU
type Exception report
message Request processing failed; nested exception is java.lang.RuntimeException: Broken Connection or Error during Connection: Server returned HTTP response code: 503 for URL: https://legacyorigin-rtv2-production.rottentomatoes.com/api/private/v1.0/wordpress/header?country=RU java.io.IOException: Server returned HTTP response code: 503 for URL: https://legacyorigin-rtv2-production.rottentomatoes.com/api/private/v1.0/wordpress/header?country=RU
description The server encountered an internal error that prevented it from fulfilling th