Skip to content

Instantly share code, notes, and snippets.

View Jordan-Hall's full-sized avatar
💭
Faced with tyranny by the big corporation, open source becomes the resistance.

Jordan Hall Jordan-Hall

💭
Faced with tyranny by the big corporation, open source becomes the resistance.
  • Mansfield woodhouse
View GitHub Profile
@Jordan-Hall
Jordan-Hall / nx+16.8.1.patch
Last active January 15, 2024 12:23
Bun as a NX package manager
diff --git a/node_modules/nx/schemas/nx-schema.json b/node_modules/nx/schemas/nx-schema.json
index 091b7d0..227e128 100644
--- a/node_modules/nx/schemas/nx-schema.json
+++ b/node_modules/nx/schemas/nx-schema.json
@@ -201,7 +201,7 @@
"packageManager": {
"type": "string",
"description": "The default package manager to use.",
- "enum": ["yarn", "pnpm", "npm"]
+ "enum": ["yarn", "pnpm", "npm", "bun"]
@Jordan-Hall
Jordan-Hall / ast-merge-vite-config.ts
Last active January 14, 2023 01:12
Merge vite config via ast
import * as ts from 'typescript';
import { readFileSync, writeFileSync, mkdirSync, existsSync } from 'fs';
import { dirname } from 'path';
function mergeDeeply(first: ts.ObjectLiteralExpression, second: ts.ObjectLiteralExpression) {
const mergedProperties: ts.ObjectLiteralElementLike[] = [];
// Add properties from first object
for (const prop of first.properties) {
mergedProperties.push(prop);
@Jordan-Hall
Jordan-Hall / style.css
Created March 29, 2022 14:45
Accessibility css
* {
cursor: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACwAAAAsCAYAAAAehFoBAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJBJREFUeNrs2dEKgDAIhWEN3/+VLYtBF12MppHwDxY0uvg4DJpORcSl0bB4uPcwq+oFHu8/956pbtJsAAYMGDBgwIABA044t3pMEgb8VU2XsWdn1o/aUUn4bchPBWNFYWvVidxbCFGmr7YULBs1YDPfsYcXEi9ryvDjAAwYMGDAgAED7nK8bHG7qNLs6nYXYAAheh5j8Qw5fwAAAABJRU5ErkJggg==) 22 22, auto !important;
}
@Jordan-Hall
Jordan-Hall / vite.config.js
Created February 20, 2022 11:55
vite test angular?
import { defineConfig } from 'vite';
import { AngularPlugin } from '@nxext/angular/plugins/angular-vite-compiler';
export default defineConfig({
plugins: [
AngularPlugin(),
],
resolve: {
preserveSymlinks: true,
},
@Jordan-Hall
Jordan-Hall / jwt.ts
Created December 20, 2020 01:16
Alosaur Session JWT
import { AuthClaims, AuthenticationScheme, Identity } from "https://deno.land/x/alosaur@v0.26.0/src/security/authentication/core/mod.ts";
import { Content } from "https://deno.land/x/alosaur@v0.26.0/mod.ts";
import { SecurityContext } from "https://deno.land/x/alosaur@v0.26.0/src/security/context/security-context.ts";
import { verify as verifySignature } from "https://deno.land/x/djwt@v1.9/_signature.ts";
import { create, decode, getNumericDate } from "https://deno.land/x/djwt@v1.9/mod.ts";
import { Algorithm } from "https://deno.land/x/djwt@v1.9/_algorithm.ts";
import { DAYS_30 } from "../../../auth/environmental.ts";
export const IdentityKey = "__identity_jwt";
const AuthorizationHeader = "Authorization";
import { connect, Redis } from "https://deno.land/x/redis/mod.ts";
import { SessionStore } from "https://deno.land/x/alosaur@v0.26.0/src/security/session/src/store/store.interface.ts";
type StringKeyObject = { [key: string]: unknown };
export class RedisSession<T = StringKeyObject> implements SessionStore {
private redis?: Redis;
private allSid: string[] = [];
if (typeof globalThis.randomUUID !== 'function') {
globalThis.randomUUID = () => {
return ([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g, c =>
(c ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> c / 4).toString(16)
);
}
}
@Jordan-Hall
Jordan-Hall / decorator-options.d.ts
Last active December 28, 2021 22:46
Memoize Decorator
interface MemoizeDecoratorOptions {
type: Storage;
ttl: number;
}