Handling empty data types in the service layer of a TypeScript + NestJS web service involves several strategies to ensure robustness and clarity in your application. Here's a structured approach to managing empty or null data types:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-get install jq | |
curl -s "https://api.github.com/users/kno3comma14/repos?per_page=100" | jq -r ".[].git_url" | xargs -L1 git clone |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ git remote rm origin | |
$ git remote add origin <git_repo> | |
$ git config master.remote origin | |
$ git config master.merge refs/heads/master |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo lsof -nPi -sTCP:LISTEN | |
kill -9 <pid> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
....... | |
:todo-api.middleware/wrap-cors | |
{:access-control-allow-origin [#todo-api/regex ".*"] | |
:access-control-allow-methods [:get :put :post :delete]} | |
:duct.handler/root | |
{:middleware [#ig/ref :todo-api.middleware/wrap-cors]} | |
........ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn bytes-to-int | |
([bytes] | |
(bytes-to-int bytes 0)) | |
([bytes offset] | |
(reduce + 0 | |
(map (fn [i] | |
(let [shift (* (- 4 1 i) | |
8)] | |
(bit-shift-left (bit-and (nth bytes (+ i offset)) | |
0x000000FF) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(require '[clojure.core.async :as a]) | |
(def xform (comp (map inc) | |
(filter even?) | |
(dedupe) | |
(flatmap range) | |
(partition-all 3) | |
(partition-by #(< (apply + %) 7)) | |
(flatmap flatten) | |
(random-sample 1.0) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Injectable } from '@nestjs/common'; | |
import * as ExcelJS from "exceljs"; | |
@Injectable() | |
export class AppService { | |
getHello(): string { | |
let wb = new ExcelJS.Workbook(); | |
let ws = wb.addWorksheet("sample_worksheet"); | |
ws.columns = [ |