Skip to content

Instantly share code, notes, and snippets.

View railsstudent's full-sized avatar
🏠
Researching third-party library

Connie Leung railsstudent

🏠
Researching third-party library
View GitHub Profile
@railsstudent
railsstudent / signal-onpush-cd-resources.md
Created December 22, 2023 20:02 — forked from ilirbeqirii/signal-onpush-cd-resources.md
Signal & OnPush Change Detection in v17 resources

Local Change Detection

Tomas Trajan:

            https://www.youtube.com/watch?v=sbIlz-yuxQI&t=2513s

Kevin Kreuzer:

            https://www.youtube.com/watch?v=fAFKK8JnPkI
@banyudu
banyudu / hello-wasm-with-rust-and-npm.blog.md
Last active December 25, 2023 04:51
使用Rust构建wasm包并发布到npm

使用Rust构建wasm包并发布到npm

wasm-pack-image

WebAssembly既拥有大量的前端输入(Rust、C++、Go、AssemblyScript),又拥有大量的运行时支持,可以内嵌在大量的语言中运行,也可以独立运行,可以说是编程界的(未来)最佳配角了,结合npm使用自然不在话下。

@ManotLuijiu
ManotLuijiu / logger.js
Last active July 11, 2023 09:34
Print filename and line-number to node's log with winston and morgan
const winston = require('winston');
require('winston-daily-rotate-file');
require('winston-mongodb');
const path = require('path');
const PROJECT_ROOT = path.join(__dirname, '..');
const highlight = require('cli-highlight').highlight;
const arrow = '\u276F\u276F\u25B6';
const logConfig = {
@krisek
krisek / alert.rules.yml
Last active July 16, 2024 07:49
Prometheus alert rules for node exporter
groups:
- name: node_exporter_alerts
rules:
- alert: Node down
expr: up{job="monitoring-pi"} == 0
for: 2m
labels:
severity: warning
annotations:
title: Node {{ $labels.instance }} is down
@sindresorhus
sindresorhus / esm-package.md
Last active July 26, 2024 11:10
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.
@zmts
zmts / docker.md
Last active May 19, 2024 14:47
Docker, TypeScript, Node.js

Docker, TypeScript, Node.js

Preconditions:

  • TS application listening port: 7777
|-- dist
|-- src
|-- .dockerignore
|-- Dockerfile
import { CallHandler, ExecutionContext, Injectable, NestInterceptor } from '@nestjs/common';
import { Observable } from 'rxjs';
@Injectable()
export class ExampleUploadInterceptor extends MulterInterceptor implements NestInterceptor {
private MAX_FILE_SIZE = 50 * 1024 * 1024;
constructor(
private fs: FsService,
) {
@ddieppa
ddieppa / npx command to run angular cli
Last active May 13, 2024 11:37
This is the npx command to run angular cli new project without install it globally
npx -p @angular/cli ng new hello-world-project
then locally can run
npx ng g c hello-world-component
@anisur3036
anisur3036 / .bablerc
Last active December 20, 2020 11:15
Tailwindcss with Gulp
{
"presets": ["env"]
}
var express = require('express');
var passport = require('passport');
var Strategy = require('passport-openidconnect').Strategy;
// Configure the OpenID Connect strategy for use by Passport.
//
// OAuth 2.0-based strategies require a `verify` function which receives the
// credential (`accessToken`) for accessing APIs on the user's behalf, along
// with the user's profile. The function must invoke `cb` with a user object,