Skip to content

Instantly share code, notes, and snippets.

View andreialecu's full-sized avatar

Andrei Alecu andreialecu

View GitHub Profile
@andreialecu
andreialecu / azure-app.stack.ts
Last active February 27, 2024 12:13
aws-cdk terraform
import * as cdk from "aws-cdk-lib";
import { TerraformSupport } from "./terraform-support";
import * as azureApp from "@cdk-cloudformation/tf-azuread-application";
export class AzureApplicationStack extends cdk.Stack {
constructor(scope: cdk.App, id: string, props: cdk.StackProps) {
super(scope, id, props);
// First deploy step 1, then change to 2 and deploy again
let step = 1;
@andreialecu
andreialecu / README.md
Last active April 6, 2023 17:44
Sentry NestJS GQL instrumentation
@andreialecu
andreialecu / dtf-perf.diff
Last active June 26, 2021 01:08
performance patch for @formatjs/intl-datetimeformat@4.1.5
diff --git a/src/abstract/FormatDateTimePattern.js b/src/abstract/FormatDateTimePattern.js
index 47fd27397f6fff014af1c4b8862e26fea11e7aab..8d0d1234d9a5dcbd6131bbe206d4655a6c153726 100755
--- a/src/abstract/FormatDateTimePattern.js
+++ b/src/abstract/FormatDateTimePattern.js
@@ -32,6 +32,28 @@ function offsetToGmtString(gmtFormat, hourFormat, offsetInMs, style) {
}
return gmtFormat.replace('{0}', offsetStr);
}
+var numberFormatsCache = new Map();
+function getNumberFormatsForLocale(locale, fractionalSecondDigits) {
@andreialecu
andreialecu / create-collapsible-navigator.tsx
Created April 21, 2021 15:42
react-navigation support for react-native-collapsible-tab-view
import {
createNavigatorFactory,
DefaultNavigatorOptions,
ParamListBase,
TabActionHelpers,
TabActions,
TabNavigationState,
TabRouter,
TabRouterOptions,
useNavigationBuilder,
@andreialecu
andreialecu / @apollo+client+3.3.14.patch
Created April 6, 2021 10:20
@apollo/client patch for fast-refresh
diff --git a/node_modules/@apollo/client/react/hooks/hooks.cjs.js b/node_modules/@apollo/client/react/hooks/hooks.cjs.js
index a0acfe8..68d0b08 100644
--- a/node_modules/@apollo/client/react/hooks/hooks.cjs.js
+++ b/node_modules/@apollo/client/react/hooks/hooks.cjs.js
@@ -56,8 +56,25 @@ function useBaseQuery(query, options, lazy) {
var queryResult = lazy
? result[1]
: result;
+ var _maybeFastRefresh;
+ if (__DEV__) {
diff --git a/deps/v8/src/base/platform/platform-posix.cc b/deps/v8/src/base/platform/platform-posix.cc
index 68d651b15fe..d5624cb8ace 100644
--- a/deps/v8/src/base/platform/platform-posix.cc
+++ b/deps/v8/src/base/platform/platform-posix.cc
@@ -415,6 +415,16 @@ bool OS::SetPermissions(void* address, size_t size, MemoryPermission access) {
int prot = GetProtectionFromMemoryPermission(access);
int ret = mprotect(address, size, prot);
+
+ // MacOS 11.2 on Apple Silicon refuses to switch permissions from
@andreialecu
andreialecu / selection-set.decorator.ts
Created May 19, 2020 17:48
selection set decorator
/**
* EXPERIMENTAL auto populator for mongo using graphql selections set
*/
import { createParamDecorator, ExecutionContext } from "@nestjs/common";
import { Model, DocumentQuery, Document, QueryPopulateOptions } from "mongoose";
import {
FieldNode,
ArgumentNode,
@andreialecu
andreialecu / @types+mongoose+5.7.18.patch
Last active May 14, 2020 16:03
types mongoose patch
diff --git a/node_modules/@types/mongoose/index.d.ts b/node_modules/@types/mongoose/index.d.ts
index 7da3af8..636f644 100644
--- a/node_modules/@types/mongoose/index.d.ts
+++ b/node_modules/@types/mongoose/index.d.ts
@@ -41,6 +41,7 @@
// Richard Simko <https://github.com/richardsimko>
// Marek Tuchalski <https://github.com/ith>
// Jeremy Bensimon <https://github.com/jeremyben>
+// Andrei Alecu <https://github.com/andreialecu>
// The Half Blood Prince <https://github.com/tHBp>
@andreialecu
andreialecu / @types+mongoose+5.7.15.patch
Last active May 8, 2020 11:45
@types/mongoose typed model.create()
diff --git a/node_modules/@types/mongoose/index.d.ts b/node_modules/@types/mongoose/index.d.ts
index c430d7b..639365e 100644
--- a/node_modules/@types/mongoose/index.d.ts
+++ b/node_modules/@types/mongoose/index.d.ts
@@ -83,8 +83,14 @@ declare module "mongoose" {
// We can use TypeScript Omit once minimum required TypeScript Version is above 3.5
type Omit<T, K> = Pick<T, Exclude<keyof T, K>>;
+ type NonFunctionPropertyNames<T> = {
+ [K in keyof T]: T[K] extends Function ? never : K;
diff --git a/node_modules/@typegoose/typegoose/lib/typeguards.d.ts b/node_modules/@typegoose/typegoose/lib/typeguards.d.ts
index 0673d2c..3b602d7 100644
--- a/node_modules/@typegoose/typegoose/lib/typeguards.d.ts
+++ b/node_modules/@typegoose/typegoose/lib/typeguards.d.ts
@@ -3,19 +3,19 @@ import type { DocumentType, Ref, RefType } from './types';
* Check if the given document is already populated
* @param doc The Ref with uncertain type
*/
-export declare function isDocument<T, S extends RefType>(doc: Ref<T, S>): doc is DocumentType<T>;
+export declare function isDocument<T extends { _id: RefType }, S extends RefType>(doc: Ref<T, S>): doc is DocumentType<T>;