Skip to content

Instantly share code, notes, and snippets.

View isarojdahal's full-sized avatar
:electron:
Learning Everyday

Saroj Dahal isarojdahal

:electron:
Learning Everyday
View GitHub Profile
@isarojdahal
isarojdahal / gist:0ebf3ce61aa143bce638caf97c216a1a
Last active February 8, 2024 10:59
Basic Postgres commands
(JUST IN case : / => frontslash, \ => backslash)
Check postgres version:
psql --version
Connect to postgres:
psql -U postgres
(the postgres user is default superuser for the postgresSQL)
# or the above error showed any socket / Peer Authentication error; then use this;
@isarojdahal
isarojdahal / gist:1d2f7a9d61e84ee72b33f6bc2c52f25e
Last active September 11, 2023 12:53
ShadCN Setup for Atomic Based UI Structure for React-Project for Vite based Project.
Setup your React project with Vite.
pnpm add -D tailwindcss postcss autoprefixer
pnpx tailwindcss init -p
Inside tsconfig.json
"baseUrl": ".",
"paths": {
"@/*": ["./src/*"]
}
/* Program to find probability for rolling of two dies for getting sums of die faces which are either less than or greater than or equal to given number */
const validateData = (input) => {
const result = input.match(/^[<|>|=][1-6]$/);
return result != null ? true : false;
};
const checkProbability = (sign, number) => {
let resultList = [];
let noOfExhaustiveEvent = 0; // this means our favorable event.
public class AnimationBeat {
private long started;
private long a; // length of phase a
private long b; // length of phase b
private long c; // length of phase c
public AnimationBeat(){
started = System.currentTimeMillis();
this.a = 5000;
this.b = 500;
@isarojdahal
isarojdahal / a.js
Last active October 21, 2021 16:16
//shows model when document is loaded
$( document ).ready(function() {
setInterval(3000,showModel);
});
function showModel(){
$("#myModel").show();
}