Skip to content

Instantly share code, notes, and snippets.

View BuistvoPloti's full-sized avatar
fast furious

Denis BuistvoPloti

fast furious
  • Toronto, Canada
View GitHub Profile
@akexorcist
akexorcist / index.js
Last active September 13, 2024 19:03
Axios post method requesting with x-www-form-urlencoded content type. See https://axios-http.com/docs/urlencoded
const axios = require('axios')
/* ... */
const params = new URLSearchParams()
params.append('name', 'Akexorcist')
params.append('age', '28')
params.append('position', 'Android Developer')
params.append('description', 'birthdate=25-12-1989&favourite=coding%20coding%20and%20coding&company=Nextzy%20Technologies&website=http://www.akexorcist.com/')
params.append('awesome', true)
@joseluisq
joseluisq / generators-vs-asyncawait-vs-native-promises.js
Last active April 26, 2021 11:52 — forked from netroy/generators-vs-asyncawait-vs-native-promises.js
Native Promises vs Generators vs Async/Await Performance vs Bluebird Promises
const Benchmark = require('benchmark')
const co = require('co')
const bluebird = require('bluebird')
const suite = new Benchmark.Suite
suite
.add('co generators', {
defer: true,
fn: deferred => {
@DmitriiNazimov
DmitriiNazimov / pattern-decorator.js
Last active April 25, 2024 15:22
[JS ES6 Паттерн ДЕКОРАТОР (decorator)] #Паттерны #ООП #js #ES6
/**
*
* ПАТТЕРН ДЕКОРАТОР (обертка)
* Позволяет наделить обьект новыми возможностями не меняя первоначальный класс и не создавая дочерние классы
* Принцип работы: декоратор помещает целевой обьект в обьект обертку, кот-й запускает базовое поведение обьекта,
* а затем добавляет/отнимает что-то свое.
*
*/
class interface_Coffee {
TypeError: fetch failed
    at fetch (/node_modules/undici/index.js:109:13) {
  [cause]: TypeError: Invalid URL
      at new URL (node:internal/url:804:36)
      at parseURL (/node_modules/undici/lib/core/util.js:51:11)
      at Object.parseOrigin (/node_modules/undici/lib/core/util.js:117:9)
      at new Pool (/node_modules/undici/lib/dispatcher/pool.js:70:23)
      at Agent.defaultFactory (/node_modules/undici/lib/dispatcher/agent.js:22:7)
 at [dispatch] (/node_modules/undici/lib/dispatcher/agent.js:93:34)