Skip to content

Instantly share code, notes, and snippets.

View ShlomiRex's full-sized avatar
🏆
Working from home

Shlomi ShlomiRex

🏆
Working from home
View GitHub Profile
@ShlomiRex
ShlomiRex / demo.tsx
Created January 29, 2022 08:54
Dynamically add children to parent component using a button in reactjs
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 October 30, 2021 22:56
Python Selenium - Brave + Tor
_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
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 February 25, 2017 03:10
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)
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();