Skip to content

Instantly share code, notes, and snippets.

View zdychacek's full-sized avatar

Ondřej Ždych zdychacek

View GitHub Profile
@malteneuss
malteneuss / Dockerfile
Created April 28, 2022 19:43
Nextjs + Prisma DB (query and migrations) in Docker
# Adapted from https://github.com/vercel/next.js/blob/canary/examples/with-docker/Dockerfile
# Install dependencies only when needed
FROM node:16-alpine AS deps
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
RUN apk add --no-cache libc6-compat
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm ci
# Rebuild the source code only when needed
@acutmore
acutmore / README.md
Last active February 27, 2025 19:55
Emulating a 4-Bit Virtual Machine in (TypeScript\JavaScript) (just Types no Script)

A compile-time 4-Bit Virtual Machine implemented in TypeScript's type system. Capable of running a sample 'FizzBuzz' program.

Syntax emits zero JavaScript.

type RESULT = VM<
  [
    ["push", N_1],         // 1
    ["push", False],       // 2
 ["peek", _], // 3
@tjhancocks
tjhancocks / cross-gcc.sh
Created December 13, 2017 13:49
OS Dev Cross Compiler (i686-elf-gcc)
#!/bin/sh
# Options
PREFIX="$HOME/opt/cross"
TARGET="i686-elf"
DEST="/tmp/osdev"
# Add to the path, and add it to the bash profile
export PATH="$PREFIX/bin:$PATH"
@rollacaster
rollacaster / algebraic-structures.txt
Created October 21, 2017 13:01
Algebraic Structures
https://drboolean.gitbooks.io/mostly-adequate-guide
http://www.tomharding.me/2017/03/03/fantas-eel-and-specification/
https://egghead.io/courses/professor-frisby-introduces-composable-functional-javascript
https://github.com/fantasyland/fantasy-land
let itemIDs = [1, 2, 3, 4, 5];
itemIDs.reduce((promise, itemID) => {
return promise.then(_ => api.deleteItem(itemID));
}, Promise.resolve());
@gravitylow
gravitylow / codesign_gdb.md
Last active March 10, 2025 16:38 — forked from hlissner/codesign_gdb.md
Codesign gdb on macOS

If you are getting this in gdb on macOS while trying to run a program:

Unable to find Mach task port for process-id 57573: (os/kern) failure (0x5).
 (please check gdb is codesigned - see taskgated(8))
  1. Open Keychain Access
  2. In menu, open Keychain Access > Certificate Assistant > Create a certificate
  3. Give it a name (e.g. gdbc)
@hlissner
hlissner / codesign_gdb.md
Last active September 29, 2024 00:25
Codesign gdb on OSX
@robertknight
robertknight / Build.md
Last active July 8, 2022 01:32
Minimal Webpack DllPlugin example

Compile with:

webpack --config vendor.webpack.config.js
webpack --config app.webpack.config.js

Use with the following index.html

Pattern Matching

This is a strawman proposal for adding pattern matching to ECMAScript. Pattern matching is useful for matching a value to some structure in a similar way to destructuring. The primary difference between destructuring and pattern matching are the use cases involved - destructuring is useful for binding pieces out of larger structures whereas pattern matching is useful for mapping a value's structure to data or a set of behaviors. In practice this means that destructuring tends to allow many shapes of data and will do its best to bind something out of it, whereas pattern matching will tend to be more conservative.

Additionally, the power of pattern matching is increased substantially when values are allowed to participate in the pattern matching semantics as a matcher as well as a matchee. This proposal includes the notion of a pattern matching protocol - a symbol method that can be implemented by objects that enables developers to use those values in pattern matching. A common scenario w

@amir-rahnama
amir-rahnama / README.md
Last active June 5, 2019 14:07
A simple Webpack (with Dev Server) + Gulp Configuration + LiveReload + Babel to playground where you can code ES6 without the need for React

A simple Webpack + Gulpfile configuration wihtout any need for React.js that assumes you have the following project structure:

node_modules/ bower_components/ scripts/

Entry script is in scripts/entry.js

You should run gulp && gulp build-dev and you are good to go.