Skip to content

Instantly share code, notes, and snippets.

View ezzabuzaid's full-sized avatar
🎯
Focusing

ezzabuzaid ezzabuzaid

🎯
Focusing
View GitHub Profile
import fs, { rm } from 'fs';
import { mkdir, writeFile } from 'fs/promises';
import git from 'isomorphic-git';
import http from 'isomorphic-git/http/node';
import os from 'os';
import { dirname, join } from 'path';
import { Context, Inject, Injectable, ServiceLifetime } from 'tiny-injector';
import { v4 } from 'uuid';
import { safeFail } from '@faslh/utils';
@ezzabuzaid
ezzabuzaid / rxjs-server.ts
Created October 2, 2024 20:54
rxjs-server.mjs
import { Console } from 'node:console';
import { createReadStream, createWriteStream } from 'node:fs';
import {
type IncomingMessage,
type ServerResponse,
createServer,
} from 'node:http';
import { Readable } from 'node:stream';
import ollama from 'ollama';
import {
@ezzabuzaid
ezzabuzaid / config.json
Last active August 13, 2024 12:36
january-todo.md
{
"projectName": "Todo API",
"title": "Todo API",
"description": "A simple API for managing todos",
"extensions": ["core", "identity", "postgresql", "hono", "fly"],
"sourceCode": "",
"author": {
"name": "January",
"url": "https://github.com/JanuaryLabs"
}
projectName extensions
HTTP trigger project
core,identity,hono,fly,postgresql,google-cloud-storage
export default project(
  feature('blogs', {
    workflows: [
 workflow('UploadSingleFileWorkflow', {
---
projectName: "HTTP trigger project"
extensions: "core,identity,hono,fly,postgresql"
---
```ts
export default project(
feature('InventoryFeature', {
policies: {
cambodiaClient: policy.country('Cambodia'),
projectName extensions
HTTP trigger project
core,identity,hono,fly,postgresql,github
export default project(
  feature('products', {
    tables: {
 issues: table({
projectName extensions
Firebase Authentication
core,identity,hono,fly,postgresql,firebase-auth
export default project(
  feature('products', {
    policies: {
 isAuthenticated: policy.authenticated(),
projectName extensions
HTTP trigger project
core,identity,hono,fly,postgresql
export default project(
	feature('Users', {
		tables: {
 users: table({
@ezzabuzaid
ezzabuzaid / todo.ts
Last active August 13, 2024 12:35
Todo API using Canon DSL
export default project(
feature('Todo', {
tables: {
tasks: table({
fields: {
title: field({ type: 'short-text', validations: [mandatory()] }),
completed: field({ type: 'boolean' }),
},
}),
},
@ezzabuzaid
ezzabuzaid / morph-inject.ts
Last active April 22, 2024 15:47
Migrate constructor injection to the new inject function.
import * as morph from 'ts-morph';
/**
* By default any component, directive, pipe, or service that have superclass is discarded
*
* If you want to permit some superclasses.
*/
const ALLOWED_SUPER_CLASSES: string[] = [];