Skip to content

Instantly share code, notes, and snippets.

View teimurjan's full-sized avatar
:electron:

Teimur Gasanov teimurjan

:electron:
View GitHub Profile
@teimurjan
teimurjan / svelte-vs-others.csv
Last active October 18, 2019 05:38
Svelte vs others
We can make this file beautiful and searchable if this error is corrected: It looks like row 2 should actually have 4 columns, instead of 1 in line 1.
Svelte;Other SPA libraries (React, Vue.js, Angular, etc.);
1. Open a website 2. Render the page using pure JS;1. Open a website 2. Wait until the code for building a virtual DOM is loaded 3. Render the page using the library;
@teimurjan
teimurjan / replaceImports.js
Created March 30, 2020 08:07
Replace relative JS imports
var fs = require("fs");
var path = require("path");
const replaceImports = (pathToDir, replace) =>
fs.readdir(pathToDir, function(err, files) {
if (err) {
console.error("Could not list the directory.", err);
process.exit(1);
}
@teimurjan
teimurjan / 1.js
Created March 26, 2021 05:52
react-gistlab
module.exports = { foo: 'bar' };
import { Suspense, useState, useEffect } from 'react';
function toResource(promise) {
let status = "pending";
let result;
let suspender = promise.then(
(r) => {
status = "success";
result = r;
},