Skip to content

Instantly share code, notes, and snippets.

View medikoo's full-sized avatar

Mariusz Nowak medikoo

View GitHub Profile
@karpathy
karpathy / min-char-rnn.py
Last active June 25, 2025 17:28
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)
@HyperBrain
HyperBrain / lifecycle-cheat-sheet.md
Last active March 14, 2025 05:30
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,

@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)
@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'
@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

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

#! js -m foo
#! node foo
@ceejbot
ceejbot / esm_in_node_proposal.md
Last active June 20, 2024 10: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