Skip to content

Instantly share code, notes, and snippets.

View medikoo's full-sized avatar

Mariusz Nowak medikoo

View GitHub Profile
@ceejbot
ceejbot / esm_in_node_proposal.md
Last active July 17, 2023 02:45
npm's proposal for supporting ES modules in node

ESM modules in node: npm edition

The proposal you’re about to read is not just a proposal. We have a working implementation of almost everything we discussed here. We encourage you to checkout and build our branch: our fork, with the relevant branch selected. Building and using the implementation will give you a better understanding of what using it as a developer is like.

Our implementation ended up differing from the proposal on some minor points. As our last action item before making a PR, we’re writing documentation on what we did. While I loathe pointing to tests in lieu of documentation, they will be helpful until we complete writing docs: the unit tests.

This repo also contains a bundled version of npm that has a new command, asset. You can read the documentation for and goals of that comma

Various command line applications use an Interpreter Directive to define how they should be run.

#! js -m foo
#! node foo
@WebReflection
WebReflection / hyper-nitty-gritty.js
Last active May 30, 2023 06:09
hyperHTML, the nitty gritty
// used to retrieve template content
const templates = new WeakMap;
// used to retrieve node updates
const updates = new WeakMap;
// hyperHTML, the nitty gritty
function hyperHTML(chunks, ...interpolations) {
// if the static chunks are unknown
@medikoo
medikoo / stacks-map.js
Last active October 30, 2017 13:31
Serverless: Nested stacks per function
'use strict';
const memoize = require('memoizee');
const namingUtils = require('serverless/lib/plugins/aws/lib/naming');
const getApiGatewayResourceMap = memoize(serverless => {
// AwsCompileApigEvents plugin provides access to data maps and methods
// that allow to easily map generated resources to lambdas
const apiGatewayPlugin = serverless.pluginManager.plugins.find(
plugin => plugin.constructor.name === 'AwsCompileApigEvents'
@bmeck
bmeck / proposal-no-path-searching.md
Last active February 6, 2018 17:20
Removal of path searching / defining a hook for migration.

Problem

There has been no progress in working towards a single cohesive story for path resolution between Servers and Web. Notable discussion points relevant to this are:

  1. Node has a path searching algorithm.
  2. Web has not been able to gather support for any of the following:
    1. Build tooling as part of UX expectations (lack of interest)
    2. Smarter static web servers (lack of interest). PoC example at https://github.com/bmeck/esm-http-server
  3. A resolve based hook. (interest shown with desire for ~6 months of userland experimentation)
@HyperBrain
HyperBrain / lifecycle-cheat-sheet.md
Last active March 20, 2024 00:17
Serverless Lifecycle Cheat Sheet

Serverless plugin author's cheat sheet

This cheat sheet provides a detailed overview of the exposed lifecycle events and available commands (and entrypoints) of the Serverless framework, that can be hooked by plugins (internal and external ones). The document is structured by the commands invoked by the user.

Lifecycle events are shown as the globally available outer events (all providers) and sub lifecycle events that are provider specific in the called order. Currently only the AWS provider is shown. If you have information about the other provider,

@karpathy
karpathy / min-char-rnn.py
Last active April 16, 2024 18:25
Minimal character-level language model with a Vanilla Recurrent Neural Network, in Python/numpy
"""
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy)
BSD License
"""
import numpy as np
# data I/O
data = open('input.txt', 'r').read() # should be simple plain text file
chars = list(set(data))
data_size, vocab_size = len(data), len(chars)

Programista/Programistka JavaScript

Do zespołu konsultantów pracujących bezpośrednio dla UNCTAD (organ ONZ) poszukujemy programisty/programistki JavaScript (HTML5 + Node.js)

Zajmujemy się tworzeniem aplikacji, których długofalowym celem jest zmniejszenie szarej strefy w krajach rozwijających się, a konkretniej umożliwienie obywatelom rejestracji różnego rodzaju działalności przez internet.

Realizujemy projekty z wykorzystaniem najnowszych otwartych technologii (full-stack JavaScript, bazowany na ECMAScript 5 oraz implementowalnych w ES5 funkcjonalnościach z najnowszego standardu ES). Pracujemy na in house'owym, modularnym stack’u, bazującym na dziesiątkach niezależnych, stale rozwijanych modułach, w większości opublikowanych na npm’ie. Dajemy możliwość upubliczniania generycznej części pracy na Github'ie lub podobnych serwisach.

Jeżeli lubisz JavaScript, lubisz dyskutować o rozwoju języka, omawiać ciekawe algorytmiczne problemy, i przede wszystkim chcesz się rozwijać jako programista JavaScript, to

@drkarl
drkarl / gist:739a864b3275e901d317
Last active October 17, 2023 10:43
Ask HN: Best Linux server backup system?

Linux Backup Solutions

I've been looking for the best Linux backup system, and also reading lots of HN comments.

Instead of putting pros and cons of every backup system I'll just list some deal-breakers which would disqualify them.

Also I would like that you, the HN community, would add more deal breakers for these or other backup systems if you know some more and at the same time, if you have data to disprove some of the deal-breakers listed here (benchmarks, info about something being true for older releases but is fixed on newer releases), please share it so that I can edit this list accordingly.

  • It has a lot of management overhead and that's a problem if you don't have time for a full time backup administrator.
@subfuzion
subfuzion / global-gitignore.md
Last active April 19, 2024 16:01
Global gitignore

There are certain files created by particular editors, IDEs, operating systems, etc., that do not belong in a repository. But adding system-specific files to the repo's .gitignore is considered a poor practice. This file should only exclude files and directories that are a part of the package that should not be versioned (such as the node_modules directory) as well as files that are generated (and regenerated) as artifacts of a build process.

All other files should be in your own global gitignore file:

  • Create a file called .gitignore in your home directory and add any filepath patterns you want to ignore.
  • Tell git where your global gitignore file is.

Note: The specific name and path you choose aren't important as long as you configure git to find it, as shown below. You could substitute .config/git/ignore for .gitignore in your home directory, if you prefer.