Skip to content

Instantly share code, notes, and snippets.

import 'dart:io';
void main() {
// 1.
int monthCount = 3;
switch (monthCount) {
case 1:
print('Январь');
break;
case 2:
import 'dart:math';
void main() {
// 1.
String text = 'hello world';
revert(text);
// 2.
var ar = [1, 22, 3, 40, 12];
var result = avg(ar);
// 1.
class User {
User(this.name, this.surname);
String name;
String surname;
@override
String toString() {
return 'User(name: $name, surname: $surname)';
import 'dart:io';
Future<void> main() async {
// 1.
print('Что говорит собачка?');
var value = await userInput();
print('Введена строка $value');
print('\nЧто говорит кошка?');
userInput().then((value) => print('Введена строка $value'));
@webmstk
webmstk / serve.js
Created May 27, 2023 20:09 — forked from martinrue/serve.js
Using esbuild's serve function for an SPA, equivalent to webpack's `devServer.historyApiFallback`.
const http = require("http");
const esbuild = require("esbuild");
const serve = async (servedir, listen) => {
// Start esbuild's local web server. Random port will be chosen by esbuild.
const { host, port } = await esbuild.serve({ servedir }, {});
// Create a second (proxy) server that will forward requests to esbuild.
const proxy = http.createServer((req, res) => {
// forwardRequest forwards an http request through to esbuid.