Skip to content

Instantly share code, notes, and snippets.

View dima-kov's full-sized avatar

Dmytro Kovalchuk dima-kov

  • Kyiv, Ukraine
View GitHub Profile
@gr2m
gr2m / account_dreamcode.js
Last active May 7, 2022 08:22
Imagine the typical backend tasks for user authentication would exist right in the browser. How would the code look like? This is what I came up with. Forks & comments much appreciated! #nobackend #dreamcode
// sign up
account.signUp('joe@example.com', 'secret');
// sign in
account.signIn('joe@example.com', 'secret');
// sign in via oauth
account.signInWith('twitter');
// sign out
@cferdinandi
cferdinandi / extend.js
Last active August 17, 2023 23:26
A native JS extend() function.
/**
* Merge defaults with user options
* @private
* @param {Object} defaults Default settings
* @param {Object} options User options
* @returns {Object} Merged values of defaults and options
*/
var extend = function ( defaults, options ) {
var extended = {};
var prop;
@SQiShER
SQiShER / docker_stats_with_names.sh
Last active May 5, 2020 07:35
Docker stats with Container Names instead of IDs
docker stats $(docker inspect -f '{{.Name}}' $(docker ps -q) | cut -c 2-)