Skip to content

Instantly share code, notes, and snippets.

View avipars's full-sized avatar
🎯
Focusing

Avi Parshan avipars

🎯
Focusing
View GitHub Profile
@avipars
avipars / ip.ps1
Created August 16, 2022 10:25
IP Tracking and Whitelist
Set-Location -Path "C:\temp" #any main directory
$uri = "https://whatismyip.host/ip4" #any website which can provide an IPV4 in text form
#old http://ifconfig.me/ip
$ipv4 = (Invoke-WebRequest -uri $uri).Content #gets the public IP
$currentip = "1.2.3.4" #initial IP to start with
$val = $true
$exists = $false
@avipars
avipars / dev.goggles
Last active August 2, 2022 10:41
dev goggles
! name: Tech and Developer Search
! description: Boost more relevant pages and blogs, take down less relevant ones
! public: true
! author: Avipars
$discard
$downrank,site=medium.com
$discard
$downrank,site=geeksforgeeks.com
@avipars
avipars / friends.cpp
Created July 25, 2022 16:32
cpp files
Food * gMeal[2]
= new Fish();
= new Dessert();
MyString &operator+(char c);
friend MyString&operator(char c, MyString s);
@avipars
avipars / Point.cpp
Last active April 24, 2022 17:07
OOP
/*
Avraham Parshan -
Course: C++ Workshop
Excersice: 1, Week 7
Date: 4/7/2022
*/
#include "Point.h"
#include <cmath> //sqrt function
@avipars
avipars / bubblesort.mips.s
Created April 8, 2022 19:11 — forked from manudatta/bubblesort.mips.s
Bubble sort in MIPS assembly.
# Copyright 2002 Manu Datta (gmail.com ID Manu dot Datta)
# All rights reserved
.data
msg1: .asciiz "\nEnter integer values followed by return (-1 terminates input): \n"
msg2: .asciiz ","
msg3: .asciiz "Bubble Sort"
msg4: .asciiz "#########pass#########"
msg5: .asciiz "\n"
msg6: .asciiz "\nNumber list has been sorted\n"
@avipars
avipars / wsl2.ps1
Created April 6, 2022 10:24
WSL 2 using powershell
wsl --list --online
wsl --set-default-version 2 #make sure to use the updated kernel https://docs.microsoft.com/en-us/windows/wsl/install-manual#step-4---download-the-linux-kernel-update-package
#wsl --install -d Debian
@avipars
avipars / file.js
Last active February 2, 2022 19:46
JCT - Language switch
javascript:document.querySelector('select[ng-model="model.currentLanguage"]').selectedIndex = 1;angular.element(document.querySelector('select[ng-model="model.currentLanguage"]')).triggerHandler('change');document.querySelector('div[local-title="title_local_switcher"] button[local="ok_button"]').click();
@avipars
avipars / index.html
Created February 2, 2022 09:41
Wordle
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no" />
<title>Wordle - A daily word game</title>
<meta name="description" content="Guess the hidden word in 6 tries. A new puzzle is available each day.">
using namespace std;
#include <iostream>
#include <cmath>
//Question 11 (7 points) moed b 5778
//Consider an array of unique integers terminated by the value 0 (0 is not considered part of the array). Write a function that receives a pointer to the array (it does not receive its size) and returns the distance between the position of the largest element in the array and the smallest one.
int pointGap(int *arr)
{
int distance = 0;
int smallest = *arr;
int largest = *arr;
@avipars
avipars / biaryPermutate.cpp
Created November 9, 2021 12:00
I needed a quick solution to check permutations and substitutions
using namespace std;
bool isEq = false;
int equ = 0;
int isOne(bool number)
{
if (number)
{