Skip to content

Instantly share code, notes, and snippets.

View zaagan's full-sized avatar
🤘
Hey !! Have a nice day

Ozesh Thapa zaagan

🤘
Hey !! Have a nice day
View GitHub Profile
@zaagan
zaagan / zustand-example.ts
Created February 16, 2024 14:06
Quick example on how to use zustand
// Source: https://github.com/cosdensolutions/code/tree/master/videos/long/zustand-tutorial
// store.ts
import { create } from "zustand";
type CounterStore = {
count: number;
increment: () => void;
incrementAsync: () => Promise<void>;
decrement: () => void;
};
@zaagan
zaagan / invalid-zips.json
Created January 19, 2023 07:26 — forked from lsl/invalid-zips.json
JSON list of valid and invalid US ZIP codes
["00000", "00001", "00002", "00003", "00004", "00005", "00006", "00007", "00008", "00009", "00010", "00011", "00012", "00013", "00014", "00015", "00016", "00017", "00018", "00019", "00020", "00021", "00022", "00023", "00024", "00025", "00026", "00027", "00028", "00029", "00030", "00031", "00032", "00033", "00034", "00035", "00036", "00037", "00038", "00039", "00040", "00041", "00042", "00043", "00044", "00045", "00046", "00047", "00048", "00049", "00050", "00051", "00052", "00053", "00054", "00055", "00056", "00057", "00058", "00059", "00060", "00061", "00062", "00063", "00064", "00065", "00066", "00067", "00068", "00069", "00070", "00071", "00072", "00073", "00074", "00075", "00076", "00077", "00078", "00079", "00080", "00081", "00082", "00083", "00084", "00085", "00086", "00087", "00088", "00089", "00090", "00091", "00092", "00093", "00094", "00095", "00096", "00097", "00098", "00099", "00100", "00101", "00102", "00103", "00104", "00105", "00106", "00107", "00108", "00109", "00110", "00111", "00112", "00113
@zaagan
zaagan / Modules Import Export.js
Last active January 8, 2023 20:49
Modules Import Export
// Exporting individual features
export let name1, name2, …, nameN;
// also var, const
export let name1 = …, name2 = …, …, nameN;
// also var, const
export function functionName(){...}
export class ClassName {...}
@zaagan
zaagan / rails http status codes
Created January 26, 2022 09:54 — forked from mlanett/rails http status codes
HTTP status code symbols for Rails
HTTP status code symbols for Rails
Thanks to Cody Fauser for this list of HTTP responce codes and their Ruby on Rails symbol mappings.
Status Code Symbol
1xx Informational
100 :continue
101 :switching_protocols
102 :processing
/**
* Retrieves all the rows in the active spreadsheet that contain data and logs the
* values for each row.
* For more information on using the Spreadsheet API, see
* https://developers.google.com/apps-script/service_spreadsheet
*/
function readRows() {
var sheet = SpreadsheetApp.getActiveSheet();
var rows = sheet.getDataRange();
var numRows = rows.getNumRows();
@zaagan
zaagan / javascript:number_to_currency
Created February 21, 2020 11:53 — forked from Foodguru/javascript:number_to_currency
javascript: number to currency. Rails like
function number_to_currency(number, options) {
try {
var options = options || {};
var precision = options["precision"] || 2;
var unit = options["unit"] || "$";
var separator = precision > 0 ? options["separator"] || "." : "";
var delimiter = options["delimiter"] || ",";
var parts = parseFloat(number).toFixed(precision).split('.');
return unit + number_with_delimiter(parts[0], delimiter) + separator + parts[1].toString();
@zaagan
zaagan / Project management.txt
Created October 25, 2020 06:33
A Project management template for official usage
## A Basic Project management folder structure ##
└─ Root Folder [ Project Title ]
└─ Customer Documents
└─ Management
└─ Contract
└─ Customer Feedback
└─ HR
└─ Proposal
└─ Reports
@zaagan
zaagan / CoruseWriteService.xer
Created July 19, 2020 09:46
Course Sample Data
void CreateCourse(Course)
void UpdateCourse(Course)
@zaagan
zaagan / CoruseReadService.xer
Created July 19, 2020 09:40
Course Read Service Sample Data
List<Course> GetTop10Courses()
CourseDetail GetCourseDetail(courseID)
List<Course> GetCourses(courseName, limit, offset)
@zaagan
zaagan / CourseInfo.xer
Last active July 19, 2020 09:37
Course Sample Data
List<Course> GetTop10Courses()
CourseDetail GetCourseDetail(courseID)
List<Course> GetCourses(courseName, limit, offset)
void CreateCourse(Course)
void UpdateCourse(Course)