Skip to content

Instantly share code, notes, and snippets.

View ff6347's full-sized avatar
🤖
updating status…

Fabian Morón Zirfas ff6347

🤖
updating status…
View GitHub Profile
@tangentstorm
tangentstorm / sh.mjs
Last active May 20, 2024 08:49
shorthand javascript
// sh.mjs: javascript shorthand
// array helpers (apl/j/k)
export const id=x=>x
export const af=(n,x)=>Array(n).fill(x) // TODO: make this 'afl' or 'fil' (aa?)
export const ii=(n,f)=>{for(let i=0;i<n;i++)f(i)}
export const im=(n,f)=>af(n,0).map((_,i)=>f(i))
export const ia=(n,f)=>im(n,id)
export const at=(a,ixs)=>ixs.map(i=>a[i])
export const io=(xs,ys)=>ys.map([].indexOf.bind(xs))
@guest271314
guest271314 / javascript_engines_and_runtimes.md
Last active May 14, 2024 18:15
A list of JavaScript engines, runtimes, interpreters

V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++. It is used in Chrome and in Node.js, among others. It implements ECMAScript and WebAssembly, and runs on Windows 7 or later, macOS 10.12+, and Linux systems that use x64, IA-32, ARM, or MIPS processors. V8 can run standalone, or can be embedded into any C++ application.

SpiderMonkey is Mozilla’s JavaScript and WebAssembly Engine, used in Firefox, Servo and various other projects. It is written in C++, Rust and JavaScript. You can embed it into C++ and Rust projects, and it can be run as a stand-alone shell. It can also be [compiled](https://bytecodealliance.org/articles/making-javascript-run-fast-on

@khalidx
khalidx / node-typescript-esm.md
Last active May 8, 2024 07:58
A Node + TypeScript + ts-node + ESM experience that works.

The experience of using Node.JS with TypeScript, ts-node, and ESM is horrible.

There are countless guides of how to integrate them, but none of them seem to work.

Here's what worked for me.

Just add the following files and run npm run dev. You'll be good to go!

package.json

@ff6347
ff6347 / README.md
Last active December 3, 2023 13:52 — forked from versionsix/README.md
OmniGraffle: Export layers on top of base-layer as PNG

Layer export for OmniGraffle

If you have a Graffle document (doc.graffle) with a canvas named "mycanvas" holding the following layers ...

  • Extra 3
  • Extra 2
  • Extra 1
  • Base

... then these images will be generated:

@ff6347
ff6347 / index.html
Last active August 28, 2023 11:50
Small page to make requests and see what happens, mainly for testing CORS requests. Deployed to vercel https://cors-requester.vercel.app/
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta http-equiv="x-ua-compatible" content="ie=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<title>CORS Tester</title>
@mchiang0610
mchiang0610 / ollama.txt
Last active May 5, 2024 20:34
ollama run models - august 10 2023
codeup:13b
codeup:13b-llama2
codeup:13b-llama2-chat
codeup:13b-llama2-chat-q2_K
codeup:13b-llama2-chat-q3_K_L
codeup:13b-llama2-chat-q3_K_M
codeup:13b-llama2-chat-q3_K_S
codeup:13b-llama2-chat-q4_0
codeup:13b-llama2-chat-q4_1
codeup:13b-llama2-chat-q4_K_M
@kfox
kfox / README.md
Last active December 4, 2023 11:08
TCP echo server for Node.js

TCP echo server for Node.js

Usage

  1. Make sure you have a modern-ish version of Node.js installed.
  2. Type npx https://gist.github.com/kfox/1280c2f0ee8324067dba15300e0f2fd3
  3. Connect to it from a client, e.g. netcat or similar: nc localhost 9000
@JonDotsoy
JonDotsoy / README.md
Last active January 19, 2023 15:45
Conventional Commits to Terminal (zsh, sh)

Conventional Commits to Terminal (zsh, sh)

Git alias conventional-commit and m to create conventional commits so fast. And prepare the scope with the alias git scope <scope-name>.

image

How to install

Run the next line in your shell terminal

@versionsix
versionsix / README.md
Created November 19, 2021 19:58 — forked from zerok/README.md
OmniGraffle: Export layers on top of base-layer as PNG

Layer export for OmniGraffle

If you have a Graffle document (doc.graffle) with a canvas named "mycanvas" holding the following layers ...

  • Extra 3
  • Extra 2
  • Extra 1
  • Base

... then these images will be generated:

@sindresorhus
sindresorhus / esm-package.md
Last active May 20, 2024 14:52
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.