Skip to content

Instantly share code, notes, and snippets.

View ProgrammingFire's full-sized avatar
📚
Probably Learning Something New

Nouman Rahman ProgrammingFire

📚
Probably Learning Something New
View GitHub Profile
@ProgrammingFire
ProgrammingFire / config.lua
Created August 14, 2023 16:56
My LunarVim config
-- Read the docs: https://www.lunarvim.org/docs/configuration
-- Video Tutorials: https://www.youtube.com/watch?v=sFA9kX-Ud_c&list=PLhoH5vyxr6QqGu0i7tt_XoVK9v-KvZ3m6
-- Forum: https://www.reddit.com/r/lunarvim/
-- Discord: https://discord.com/invite/Xb9B4Ny
local dap = require("dap")
lvim.plugins = {
{
"catppuccin/nvim",
name = "catppuccin"
Design: https://play.tailwindcss.com/JLfoTtGfSx?layout=preview
@ProgrammingFire
ProgrammingFire / PointersInCSharp.cs
Created March 23, 2022 13:29
Pointer In C# Like C/C++
// Add <AllowUnsafeBlocks>true</AllowUnsafeBlocks> To Your *.csproj
int variable = 481;
unsafe
{
int* pointer = &variable; // Get The Pointer Of A Variable
Console.WriteLine((int)pointer); // Writes The Pointer
Console.WriteLine(*pointer); // Writes The Value
Console.WriteLine(pointer->ToString()); // Access Properties
@ProgrammingFire
ProgrammingFire / Microsoft.PowerShell_profile.ps1
Created March 16, 2022 13:31
My PowerShell Core 7 Profile
using namespace System.Management.Automation
using namespace System.Management.Automation.Language
if ($host.Name -eq 'ConsoleHost') {
Import-Module PSReadLine
}
Import-Module -Name Terminal-Icons
Function psql() {
@ProgrammingFire
ProgrammingFire / programmingfire.omp.json
Last active March 11, 2022 10:28
ProgrammingFire Oh My Posh Theme
{
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
"final_space": true,
"console_title": true,
"console_title_style": "folder",
"blocks": [
{
"type": "prompt",
"alignment": "left",
"horizontal_offset": 0,
@ProgrammingFire
ProgrammingFire / Dockerfile
Created February 3, 2022 07:08
Sample Node.JS Docker file
FROM node:latest # Replace With Your Node.JS Version
WORKDIR /app
COPY package*.json ./
RUN npm ci --only=production # Similiar To npm install
COPY . ./
ENV PORT 8000
EXPOSE ${PORT}
RUN npm run build
CMD ["npm", "run", "start"]
@ProgrammingFire
ProgrammingFire / type-safe-variables.js
Last active January 15, 2022 14:33
Type Safety In JavaScript
class Variable {
type;
value;
freeze;
constructor(value, type, freeze = false) {
if (!type) {
this.type = typeof value;
} else {
this.type = type;
@ProgrammingFire
ProgrammingFire / SimpleMap.ts
Created December 27, 2021 13:51
Map Implemented In Pure TypeScript
class MyMap<K, V> {
private map: [key: K, value: V][] = [];
set(key: K, value: V) {
const result = this.map.find(([k]) => k === key);
if (!result) {
this.map.push([key, value]);
return;
}
result[1] = value;
@ProgrammingFire
ProgrammingFire / form-field-example.scss
Created November 29, 2021 10:31
Form Field Design With SCSS
input,
textarea {
width: 30vw;
border: 2px solid #ebebf2;
border-radius: 5px;
padding: 1rem 2rem;
&:focus {
outline: none;
border: 2px solid #7985ff;
@ProgrammingFire
ProgrammingFire / Dockerfile
Created November 17, 2021 11:04
NestJS Docker Image Example
FROM node:latest
WORKDIR /app
COPY package*.json ./
RUN npm ci --only=production
COPY . ./
ENV NODE_ENV production
ENV PORT 8000
EXPOSE ${PORT}
RUN npm run test
RUN npm run build