Skip to content

Instantly share code, notes, and snippets.

View barisbll's full-sized avatar

Barış BALLI barisbll

View GitHub Profile
@barisbll
barisbll / note-for-debug.txt
Last active July 31, 2023 13:54
Best way to debug typescript express apps in vscode
After creating your app just going to terminal
Clicking next to the plus button and opening javascript debug terminal
Then simply calling your app's running script, for me npm run start:dev
@barisbll
barisbll / package.json
Last active July 19, 2023 10:17
dummy-lib package.json after changeset
{
"name": "@barisbll/dummy-lib",
"version": "1.0.2",
"description": "A dummy library to make a library deployment example",
"main": "index.js",
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
"files": [
"/dist"
],
@barisbll
barisbll / release.yml
Created July 19, 2023 10:11
dummy-lib release workflow
name: Release
on:
push:
branches:
- main
concurrency: ${{ github.workflow }}-${{ github.ref }}
permissions: {} #reset
jobs:
release:
# IMPORTANT: prevent this action from running on forks
@barisbll
barisbll / main.yml
Created July 19, 2023 10:06
dummy-lib main workflow file
name: 'CI'
on:
pull_request:
branches:
- '**'
- '!main'
jobs:
build:
runs-on: ubuntu-latest
steps:
@barisbll
barisbll / config.json
Created July 19, 2023 09:36
dummy-lib changeset config
{
"$schema": "https://unpkg.com/@changesets/config@2.3.1/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
@barisbll
barisbll / package.json
Last active July 19, 2023 10:17
Dummy library tsup added package.json
{
"name": "@barisbll/dummy-lib", // We have to name every library uniquely
"version": "1.0.0",
"description": "A dummy library to make a library deployment example",
"main": "index.js",
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
"files": [
"/dist"
],
@barisbll
barisbll / index.ts
Created July 19, 2023 09:17
Dummy library index.ts
/**
* @description
* @param {number} n
* @returns {boolean}
* @example
* isOdd(1) // true
* isOdd(2) // false
* */
export const isOdd = (n: number) => n % 2 === 1;
@barisbll
barisbll / index.ts
Last active March 8, 2023 20:36
Typescript RPC with Observables Written By ChatGPT
import * as amqp from 'amqplib';
import { Observable, Observer } from 'rxjs';
interface RpcRequest {
correlationId: string;
resolve: (response: any) => void;
reject: (error: Error) => void;
}
class RabbitMQRpcClient {
@barisbll
barisbll / launch.json
Last active June 1, 2023 08:50
Typescript VSCode Debug Setting
{
// First build your application exp: npm run build
// Then run the index.js on debug mode exp: node --inspect ./dist/index.js
// For a running server on kubernetes after the ssh connection you can send a signal to process to open the debug mode
// exp: https://medium.com/hackernoon/debugging-node-without-restarting-processes-bd5d5c98f200
"version": "0.2.0",
"configurations": [
{
"type": "node",
@barisbll
barisbll / pre-commit
Created October 8, 2022 18:03
Husky auto created file
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"
npm test && npm run lint