Skip to content

Instantly share code, notes, and snippets.

View prameshbajra's full-sized avatar
💻
Let's talk tech.

Pramesh Bajracharya prameshbajra

💻
Let's talk tech.
View GitHub Profile
@prameshbajra
prameshbajra / Random Quote
Created June 18, 2017 13:10
Simple fetch code to generate random quote from favqs API
fetch("https://favqs.com/api/qotd")
.then((response) => {
return response.json();
})
.then((data) => {
let quote = data.quote.body;
console.log(data.quote);
document.write(`${quote} by ${data.quote.author}`);
})
.catch((error) => {
@prameshbajra
prameshbajra / gist:660d16319d333b856324c972938be163
Created August 3, 2017 16:03
Let's customize window's command prompt a bit.
// Type the following into your cmd
setx PROMPT $p$s$s$c$s$d$s$f$s:$_$c$$$f-$g$s
@prameshbajra
prameshbajra / cloudSettings
Created September 14, 2017 14:17
Visual Studio Code Settings Sync Gist
{"lastUpload":"2017-09-14T14:17:12.462Z","extensionVersion":"v2.8.3"}
@prameshbajra
prameshbajra / cloudSettings
Last active July 31, 2020 07:17
Visual Studio Code Settings Sync Gist
{"lastUpload":"2020-07-31T07:17:47.018Z","extensionVersion":"v3.4.3"}
@prameshbajra
prameshbajra / circularlinkedlist.c
Created June 5, 2018 13:41
By - Pavan Yekabote
#include<stdio.h>
#include<stdlib.h>
struct nde {
int data;
struct nde *link;
};
typedef struct nde* Node;
@prameshbajra
prameshbajra / circularlinkedlist.java
Created June 5, 2018 13:43
By - Pramesh Bajracharya
package com.demo.advjava;
public class CircularLinkedList {
Node head;
class Node {
int data;
Node next;
@prameshbajra
prameshbajra / N queens Solution.java
Last active June 6, 2018 13:38
NQueens - My solution
package com.demo.advjava;
public class NQueensTesting {
int boardSize = 8;
int[][] board = new int[boardSize][boardSize];
public void populateBoard() {
int i, j;
for (i = 0; i < boardSize; i++)
@prameshbajra
prameshbajra / TypeFun.java
Created June 7, 2018 06:44
Open a preferred application and start typing automatically.
package com.demo.advjava;
import java.awt.AWTException;
import java.awt.Robot;
import java.awt.event.KeyEvent;
import java.io.IOException;
public class NotepadFun {
public static void main(String[] args) throws IOException, InterruptedException, AWTException {
Runtime.getRuntime().exec("gedit");
@prameshbajra
prameshbajra / AdjMatGraph.java
Created June 7, 2018 08:59
Adjaceny Matric Implementation for Graph in JAVA.
package com.demo.advjava;
public class GraphImplementationAdjMat {
int[][] graph;
public GraphImplementationAdjMat(int vertices) {
graph = new int[vertices][vertices];
}