Skip to content

Instantly share code, notes, and snippets.

View sagarkarira's full-sized avatar
:octocat:
1x dev

Sagar Karira sagarkarira

:octocat:
1x dev
View GitHub Profile
@nileshtrivedi
nileshtrivedi / composable_web.md
Last active January 10, 2022 04:31
My thoughts on making the Web more composable like UNIX

The Composable Web Proposal

Serverless infrastructure like AWS Lambda and Google Cloud Functions have made it much cheaper for developers to offer server-side code for public consumption without keeping a server always running.

If these functions could be declared as stateless or deterministic, costs can be brought down even more because only the first invocation needs to be executed. Cached response could be returned for future invocations with the same input arguments.

All modern browsers support URL lengths of thousands of characters, even on mobile. A lot of data can be embedded and passed around directly in the URLs (instead of passing identifiers which requires a look-up which costs server time).

So here's a thought:

@ruanbekker
ruanbekker / cheatsheet-elasticsearch.md
Last active March 23, 2026 03:03
Elasticsearch Cheatsheet : Example API usage of using Elasticsearch with curl
'use strict';
/**
* =============================================================================================
* A state container
* @exports {Object} Continer
*
* // in the very beginning
* const con = require('container.js')
* con.add('logger', new Logger('log'));
@Birdie0
Birdie0 / ifttt-webhooks-extended-guide.md
Last active March 3, 2026 06:19
How to use Discord Webhooks

⚠️ This gist is no longer updated! For maintained, improved and even more extended guide click here.


How to use Discord Webhook

It's a JSON

First, learn JSON. It's not programming language, not even close. Just follow syntax rules and you will be fine.

FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.


Effective Engineer - Notes

What's an Effective Engineer?

@LeCoupa
LeCoupa / redis_cheatsheet.bash
Last active March 19, 2026 17:42
Redis Cheatsheet - Basic Commands You Must Know --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
# Redis Cheatsheet
# All the commands you need to know
redis-server /path/redis.conf # start redis with the related configuration file
redis-cli # opens a redis prompt
# Strings.
@anvk
anvk / promises_reduce.js
Last active September 8, 2024 15:10
Sequential execution of Promises using reduce()
function asyncFunc(e) {
return new Promise((resolve, reject) => {
setTimeout(() => resolve(e), e * 1000);
});
}
const arr = [1, 2, 3];
let final = [];
function workMyCollection(arr) {
@hvrauhal
hvrauhal / bb.js
Last active June 3, 2019 10:59 — forked from stephantabor/bb.js
Bluebird .mapSeries vs .map
var Promise = require('bluebird');
var funcs = Promise.resolve([100, 200, 300, 400].map((n) => makeWait(n)));
console.log('first with {concurrency: 1}');
funcs
.map(iterator, {concurrency: 1})
.then(function(r) { console.log('Resolved with', r) } )
.then(function() {
console.log('then with mapSeries');
@manigandham
manigandham / rich-text-html-editors.md
Last active November 30, 2025 19:04
Rich text / HTML editors and frameworks

Strictly Frameworks

Abstracted Editors

These use separate document structures instead of HTML, some are more modular libraries than full editors

@stephantabor
stephantabor / bb.js
Last active January 6, 2024 04:18
Bluebird .each vs .mapSeries vs .map
var Promise = require('bluebird');
var funcs = Promise.resolve([500, 100, 400, 200].map((n) => makeWait(n)));
funcs
.each(iterator) // logs: 500, 100, 400, 200
.then(console.log) // logs: [ [Function], [Function], [Function], [Function] ]
funcs
.mapSeries(iterator) // logs: 500, 100, 400, 200