I hereby claim:
- I am vithalreddy on github.
- I am vithalreddy (https://keybase.io/vithalreddy) on keybase.
- I have a public key whose fingerprint is 6293 F1F2 EC2D DC04 FD04 A909 8259 DCE2 BE2F C760
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
function ex(x, n, s = 1) { | |
if (n === 0) return s; | |
s = 1 + (x * s) / n; | |
return ex(x, n - 1, s); | |
} | |
console.log(ex(1, 10)); // 2.7182818011463845 | |
console.log(ex(5, 10)); // 146.38060102513225 |
// example code for blog post | |
// https://stackfame.com/javascript-settimeout-promise-chain | |
makeHttpCall("https://api.stackfame.com/1") | |
.then(function(data) { | |
return makeHttpCall("https://api.stackfame.com/2"); | |
}) | |
.then(function(data) { | |
return loadScript("https://api.stackfame.com/3"); | |
}) | |
.then(function(data) { |
const passwordConfig = Object.freeze({ | |
minLength: 8, | |
atleaseOneLowercaseChar: true, | |
atleaseOneUppercaseChar: true, | |
atleaseOneDigit: true, | |
atleaseOneSpecialChar: true, | |
}); | |
function verifyPasswordStrength(password) { | |
if ( |
SELECT GROUP_CONCAT('kill ',id SEPARATOR '; ') AS kill_list | |
FROM INFORMATION_SCHEMA.PROCESSLIST | |
WHERE command='Sleep'; |
import React, { useEffect, useState } from "react"; | |
import { Table, Button, Space, Row, Col } from "antd"; | |
import { LeftOutlined, RightOutlined } from "@ant-design/icons"; | |
const CursorPagination = ({ lastEvaluatedKey, onChange, size }) => { | |
/* Use stack to keep track of which evaluated keys have been previously seen */ | |
const [ prevEvaluatedKeys, setPrevEvaluatedKeys ] = useState([]); | |
/* Keep track of the current evaluated key */ | |
const [ currentEvaluatedKey, setCurrentEvaluatedKey ] = useState(null); |
/* | |
JSON-to-Go | |
by Matt Holt | |
https://github.com/mholt/json-to-go | |
A simple utility to translate JSON into a Go type definition. | |
*/ | |
function jsonToGo(json, typename) { | |
let data; | |
let scope; |
// ES6 version using asynchronous iterators, compatible with node v10.0+ | |
const fs = require("fs"); | |
const path = require("path"); | |
async function* walk(dir) { | |
for await (const d of await fs.promises.opendir(dir)) { | |
const entry = path.join(dir, d.name); | |
if (d.isDirectory()) yield* walk(entry); | |
else if (d.isFile()) yield entry; |