Skip to content

Instantly share code, notes, and snippets.

View wasit-shafi's full-sized avatar
💭
some people STOP's because it's HARD & some people START's because it's HARD!!

Wasit Shafi wasit-shafi

💭
some people STOP's because it's HARD & some people START's because it's HARD!!
View GitHub Profile

Boilerplate code for Java


// URL: 
/**
 * @author WasitShafi
 * @since 01-MAR-2023
@wasit-shafi
wasit-shafi / index.html
Created July 27, 2021 19:46
Electron Fiddle Gist for aspect ratio issue #30277
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self'">
<meta http-equiv="X-Content-Security-Policy" content="default-src 'self'; script-src 'self'">
<title>Hello World</title>
</head>
<body>
<h1>Hello World!</h1>
@wasit-shafi
wasit-shafi / electronAspectRatioOnMaximise.js
Created July 26, 2021 20:50
electron-aspect-ratio-on-maximise
const { app, BrowserWindow } = require('electron');
const createWindow = () => {
const win = new BrowserWindow({
width: 500,
height: 500,
fullscreenable: false,
});
win.setAspectRatio(1);
#include<stdio.h>
int isPrime(int n , int i)
{
if(n < 2) return 0;
if(n == 2) return 1;
if(n % i == 0) return 0;
if(i * i > n) return 1;
isPrime(n, i + 1);
}
@wasit-shafi
wasit-shafi / primeno-3.c
Created May 28, 2020 16:48
Prime Number Program
#include<stdio.h>
#include<math.h>
int main()
{
int n, i, half, isPrime = 1, square_root;
printf("Enter Value of n... ");
scanf("%d", &n);
@wasit-shafi
wasit-shafi / primeno-2.c
Last active May 28, 2020 15:57
Prime number Program
#include<stdio.h>
int main()
{
int n, i = 2, half, isPrime = 1;
printf("Enter Value of n... ");
scanf("%d", &n);
half = n / 2;
@wasit-shafi
wasit-shafi / primeno.c
Created May 28, 2020 12:47
Prime Number Program
#include<stdio.h>
int main()
{
int n, i = 2 ;
printf("Enter Value of n... ");
scanf("%d", &n);
if(n > 1)
/**
@author wasitshafi
@since 18-02-2020
*/
import java.util.TreeSet;
public class PrimeNumberOptimalApproach
{
public static boolean isPrime(int n)
{
for(int i = 2 ; i * i <= n ; i++)
@wasit-shafi
wasit-shafi / DynamicArrayInCDemo.c
Created March 5, 2020 12:44
Hackerrank Dynamic arrays in C Demo
#include<stdio.h>
int main()
{
int *bookShelf[3]; // Array of pointer to int;
int shelf1[3] = {1, 2, 3}; // constains 3 books of total pages 1, 2 & 3.
int shelf2[4] = {4, 5, 6, 7};
int shelf3[5] = {8, 9, 10, 11, 12};
int shelvesSizes[3] = {3, 4, 5}; // It is stores no. of shelves
@wasit-shafi
wasit-shafi / README.md
Created November 12, 2019 11:17 — forked from developius/README.md
Setup SSH keys for use with GitHub/GitLab/BitBucket etc

Create a new repository, or reuse an existing one.

Generate a new SSH key:

ssh-keygen -t rsa -C "your_email@example.com"

Copy the contents of the file ~/.ssh/id_rsa.pub to your SSH keys in your GitHub account settings.

Test SSH key: