Skip to content

Instantly share code, notes, and snippets.

View kno3comma14's full-sized avatar
🎯
Focused

Enyert Vinas kno3comma14

🎯
Focused
View GitHub Profile
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
$ git remote rm origin
$ git remote add origin <git_repo>
$ git config master.remote origin
$ git config master.merge refs/heads/master
@kno3comma14
kno3comma14 / gist:cbfbbb3d6cb5d4acb7ea807d5e94caae
Created July 2, 2021 04:22
Look for LISTEN process pid then kill it
sudo lsof -nPi -sTCP:LISTEN
kill -9 <pid>
@kno3comma14
kno3comma14 / config.edn
Last active August 5, 2021 05:14
Adding middleware to duct apis
.......
: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]}
........
@kno3comma14
kno3comma14 / bytes_to_int.clj
Created November 21, 2022 13:44 — forked from pingles/bytes_to_int.clj
Clojure code to convert a byte array to an integer
(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)
(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)


how to handle empty datatypes at service layer in a typescript + nestjs web service

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:

@kno3comma14
kno3comma14 / sample_excel.ts
Created March 13, 2025 09:33
Hint to create an excel
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 = [