Skip to content

Instantly share code, notes, and snippets.

View Linrstudio's full-sized avatar
🌴
On vacation

xyz Linrstudio

🌴
On vacation
View GitHub Profile
@JamieMason
JamieMason / find-nested-dependencies.md
Created March 2, 2022 12:49
Find all modules which a given JavaScript module depends on, and all they modules they depend on, and all they modules they depend on etc.

Find nested dependencies or imports of a JavaScript Module

Find all deep/nested/recursive/descendant dependencies/imports/requires of a JavaScript Module.

Related to sverweij/dependency-cruiser#564, find all modules which a given JavaScript module depends on, and all the modules they depend on, and all the modules they depend on etc.

Installation

npm install -g ts-node
@Jaid
Jaid / migratingRules.md
Last active September 30, 2024 16:14
ESLint rules for migrating projects from CommonJS to ESM

ESLint rules

The ESM standard is considered stable in NodeJS and well supported by a lot of modern JavaScript tools.

ESLint does a good job validating and fixing ESM code (as long as you don't use top-level await, coming in ESLint v8). Make sure to enable the latest ECMA features in the ESLint config.

  • .eslint.json
{
@Andy-set-studio
Andy-set-studio / _vertically-align-label.scss
Last active September 8, 2021 01:30
Adds a pseudo-element to help vertically align text labels in buttons/block-like links without using magic numbers https://ishadeed.com/article/button-label-alignment/
/// VERTICALLY ALIGN LABEL
/// Adds a pseudo-element to help vertically align
/// text labels in buttons/block-like links without
/// using magic numbers
/// More: https://ishadeed.com/article/button-label-alignment/
@mixin vertically-align-label() {
&::before {
content: '';
display: inline-block;
vertical-align: middle;
@baku89
baku89 / principles_ja.md
Last active May 14, 2021 12:35
Principles for Unclichéd Generative Arts

Don't show off what can be realized with the tool

スペック的にやれることを生かしきらない

  • 3DCGツールで2Dグラフィックスをつくる
  • 動画ソフトで静止画をつくる
  • GPU処理で本当は100万パーティクル出せるところを、あえて5個だけでめっちゃ良い感じに動かす

Try tiresome (but not impossible) expressions

@mizchi
mizchi / log
Created January 17, 2021 10:18
prisma:info Starting a sqlite pool with 17 connections.
prisma:info Started http server on http+unix:///private/tmp/prisma-789c342c854e2e3b622ab519.sock
prisma:query BEGIN
prisma:query SELECT `dev`.`User`.`id` FROM `dev`.`User` WHERE `dev`.`User`.`name` = ? LIMIT ? OFFSET ?
prisma:query SELECT `dev`.`User`.`id` FROM `dev`.`User` WHERE `dev`.`User`.`name` = ?
prisma:query UPDATE `dev`.`User` SET `name` = ? WHERE `dev`.`User`.`id` IN (?)
prisma:query SELECT `dev`.`User`.`id`, `dev`.`User`.`name` FROM `dev`.`User` WHERE `dev`.`User`.`id` = ? LIMIT ? OFFSET ?
prisma:query COMMIT
prisma:query BEGIN
prisma:query SELECT `dev`.`User`.`id` FROM `dev`.`User` WHERE `dev`.`User`.`id` = ? LIMIT ? OFFSET ?
@swyxio
swyxio / Newton-1.29.vb
Last active July 10, 2022 08:34
Newton - my VBA utility library for doing matrix multiplication and other useful automations during my finance days https://twitter.com/swyx/status/1327041894853922816
Attribute VB_Name = "Newton"
'Newton Utilities, written by swyx
'Project initiated Jan 1 2012
'V1 released Feb 5 2012
'V1.1 added and renamed functions, updated helpfiles Apr 8 2012
'V1.2 spline interp extraction from surface, n_RandomWalk. released Jun 15 2012
'V1.21 n_Corr, n_TangencyPortfolio, n_CovMat subsumed into n_Cov, fixed n_GetTimeSeries, n_AutoCorr, n_Lag, n_Pval, added PValues to n_Regress, n_Payback, n_ChartMakeScatter
'V1.22 n_Granger, pval for n_Corr, n_Divide, n_Curve, n_PriceIRS, upgraded n_BuildCurve
'V1.23 n_PriceFwd/Rate, n_AutoRegress/n_Remove_AutoRegress (needs work), augmented n_PriceOption for pricing FXO, digitals, and returning greeks
'V1.24 n_FXOVolCurve, n_FormatAsPercent linked to ctrl+shift+5, n_FormatInc/DecreaseDecimalPlace
/**
* @typedef {Object} ClassifyProps
* @property {React.ElementType} [as] - Element to render
* @property {import('clsx').ClassValue} [className] - Composable classnames passed to clsx
*/
/**
* @param {ClassifyProps} props
*/
function Classify({ as: El = "div", ...props }) {
@xdesro
xdesro / MarginTop.js
Created August 17, 2020 18:31
Godforsaken margin-top React component.
const MarginTop = (props) => (
<div>
{Array.from(Array(props.spacing)).map((br) => (
<br />
))}
{props.children}
</div>
);
ReactDOM.render(
@jdsteinbach
jdsteinbach / Subsetting.md
Created May 8, 2020 19:32
Case Studies in Font Subsetting

Case Studies in Font Subsetting

Initial Files Provided

iA Writer provided variable fonts as 2 ttfs (Upright and Italic), each ~150kb.

Note: iA Writer provided static fonts as woff2 (Regular, Italic, Bold, Bold Italic) around 45kb each. Unfortunately this can skew people's initial performance reaction away from variable fonts.