Skip to content

Instantly share code, notes, and snippets.

@belichuk
belichuk / index.js
Created May 16, 2018 16:22
Find all palindromes made from the product of two 4-digit numbers
const fs = require('fs');
const reverseNum = s => String(s).split('').reverse().join('');
const genPalindrome = (len) => {
const palindromes = new Set();
const mod = len%2 !== 0;
const iLen = ~~(len/2);
const start = Math.pow(10, iLen - 1);
const end = Math.pow(10, iLen) - 1;
for (let i = end; i >= start; i--)
@skyscribe
skyscribe / .gdbinit
Created October 30, 2012 03:04
GDB init file to print STL containers and data members
#
# STL GDB evaluators/views/utilities - 1.03
#
# The new GDB commands:
# are entirely non instrumental
# do not depend on any "inline"(s) - e.g. size(), [], etc
# are extremely tolerant to debugger settings
#
# This file should be "included" in .gdbinit as following:
# source stl-views.gdb or just paste it into your .gdbinit file