Deriving a new Array from an existing Array:
['■','●','▲'].slice(1, 3) ⟼ ['●','▲']
['■','●','■'].filter(x => x==='■') ⟼ ['■','■']
['▲','●'].map(x => x+x) ⟼ ['▲▲','●●']
['▲','●'].flatMap(x => [x,x]) ⟼ ['▲','▲','●','●']
#!/usr/bin/env node | |
// Usage: | |
// cat my-file.md | ./gist-toc.mjs | |
// pbpaste | ./gist-toc.mjs | pbcopy # clipboard -> clipboard (macOS) | |
function createSlug(str) { | |
str = str.replace(/[?%:`]/g, ''); | |
str = str.replace(/ +/g, '-'); | |
return str.toLowerCase(); |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<title>Save data in localStorage using JavaScript</title> | |
<link rel="stylesheet" href="style.css" /> | |
</head> | |
<body> | |
<form id="note-form"> |
Новая книга от одного из авторов культовой SICP (Gerald Jay Sussman) и principal author of Scheme (Chris Hanson) - «Software Design for Flexibility. How to Avoid Programming Yourself into a Corner». Авторы задаются «извечным» вопросом о гибкости кода и как ее достичь. Судя по оглавлению речь пойдет о различных техниках и подходах от комбинаторов до DSL и динамического программирования. Звучит очень интересно! https://mitpress.mit.edu/books/software-design-flexibility.
https://t.me/tripovozkiknig/62
Книга про то как делать DDD методами функционального программирования (на F#, но многие аспекты применимы к ЯП без статической типизации)
Краткая характеристика:
Плюсы:
The package that linked you here is now pure ESM. It cannot be require()
'd from CommonJS.
This means you have the following choices:
import foo from 'foo'
instead of const foo = require('foo')
to import the package. You also need to put "type": "module"
in your package.json and more. Follow the below guide.await import(…)
from CommonJS instead of require(…)
.I'm trying to create examples of all the different ways to write functions and function type definitions in TypeScript.
One requirement is these examples must work with strict mode (noImplicitAny
, etc) enabled.
If I'm missing anything, please add comments below with examples. I'll eventually put this into a blog post.
⚠️ Warning: this document is out of date.For the most recent webpack5 instructions see MIGRATION.md.
Storybook 6.2 includes experimental Webpack 5 support. Webpack 5 brings a variety of performance improvements, as well as exciting new features like module federation. Here's a quick guide to get you going.
This is inspired by A half-hour to learn Rust and Zig in 30 minutes.
Your first Go program as a classical "Hello World" is pretty simple:
First we create a workspace for our project:
This is inspired by https://fasterthanli.me/blog/2020/a-half-hour-to-learn-rust/
the command zig run my_code.zig
will compile and immediately run your Zig
program. Each of these cells contains a zig program that you can try to run
(some of them contain compile-time errors that you can comment out to play
with)