Skip to content

Instantly share code, notes, and snippets.

Avatar
🏆
Working from home

Shlomi ShlomiRex

🏆
Working from home
  • Check Point Ltd.
  • Israel
View GitHub Profile
@ShlomiRex
ShlomiRex / demo.tsx
Created Jan 29, 2022
Dynamically add children to parent component using a button in reactjs
View demo.tsx
import * as React from 'react';
import ReactDOM from "react-dom";
class Child extends React.Component {
render() {
return <div>Hi!</div>
}
}
class Parent extends React.Component {
@ShlomiRex
ShlomiRex / main.py
Created Oct 30, 2021
Python Selenium - Brave + Tor
View main.py
_brave_path = r'C:\Program Files\BraveSoftware\Brave-Browser\Application\brave.exe'
def get_brave_tor_driver():
option = webdriver.ChromeOptions()
option.binary_location = _brave_path
option.add_argument("--tor") # Launch in Tor mode
driver = webdriver.Chrome(executable_path=_chrome_driver_path, chrome_options=option)
return driver
View HackerRank-Maze-Escape-Solution.java
import java.io.*;
import java.util.*;
public class Solution {
static Random rnd;
//True - if not wall. False - if wall.
static boolean[] directions = {false,false,false,false};
static String line;
static Scanner s = new Scanner(System.in);
@ShlomiRex
ShlomiRex / My Bin Search
Created Feb 25, 2017
Search through sorted list (ascending) By given number, find the position where the number should go. Example given array: { 1, 3, 5, 7 } Number 6 will go after index 2. (after 5 and before 7) NOTE: Array must be sorted. (Not checking) NOTE: This is my algorithm. It might not be efficient but I think its doing the job. Complexity Big-O : O(lg n)
View My Bin Search
View Array-Left-Rotation.java
import java.io.*;
import java.util.*;
public class Solution {
public static void main(String[] args) {
//initializing regular code...
Scanner s = new Scanner(System.in);
int n = s.nextInt();