Skip to content

Instantly share code, notes, and snippets.

View theoctober19th's full-sized avatar
🏠
Working from home

bikalpa theoctober19th

🏠
Working from home
View GitHub Profile
@theoctober19th
theoctober19th / Application.java
Last active November 11, 2021 03:59
Selenium code corrected for Bismita
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.WebDriver;
public class Application {
public static void main(String[] args) {
System.setProperty("webdriver.chrome.driver","C:\\Users\\Dipak\\workspace\\SeleniumProject\\Drivers\\chromedrivers.exe");
WebDriver driver = new ChromeDriver();
String baseUrl ="https://www.amazon.com/ref=nav_logo";
driver.get(baseUrl);
  1. Clone the repo https://github.com/theoctober19th/cosmos_astrology at a different location somewhere in your machine. Create a new temporary branch and checkout to the branch.
  2. Run flutter pub get since a new package has been added (named flutter_dotenv)
  3. Create a file .env at the root of the project. (at the same level as pubspec.yaml file). This file will contain the credentials as environment variables, but it will not be tracked by git (already added to gitignore). Sample content of the file .env is:
ESEWA_CLIENT_ID='xxx'
ESEWA_SECRET_KEY='xxx'

KHALTI_PUBLIC_KEY='xxx'
# include <iostream>
#include <cstring>
using namespace std;
int main()
{
int choice;
char alphabets[] = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
char key[]= "bdafzLPmNRxTcVQX+UWSKMpFknHy*EGIqZhtvYDgrCulAwoBsjei_";
char encrypted_message[50];
char decrypted_message[50];
#Duration
duration_options = response.css('div.field-name-field-length-of-program').xpath('./descendant::div[contains(@class,"field-item")]/text() | ./descendant::div[contains(@class,"field-item")]/p/text()').getall()
fulltime, parttime = False, False
try:
duration_text = duration_options[0].strip()
except:
duration_text = ''
for duration_option in duration_options:
if 'full' in duration_option.strip().lower():
duration_text = duration_option.strip()
@theoctober19th
theoctober19th / brackets.py
Created May 25, 2020 16:48
Python function that checks if the brackets in a given string are balanced:
def is_balanced(string):
stack = []
for ch in string:
if ch in ['(', '{', '[']:
stack.append(ch)
else:
if ch == ')' and stack and stack[-1] == '(':
stack.pop()
if ch == '}' and stack and stack[-1] == '{':
stack.pop()
@theoctober19th
theoctober19th / file.py
Created May 25, 2020 16:45
Given: 1 -> 2 -> 3 + 4 -> 5 -> 6. Expected output: 5 -> 7 -> 9
def add(li1, li2):
sum = []
while li1 and li2:
sum.append(li1.pop(0) + li2.pop(0))
while li1:
sum.append(li1.pop(0))
while li2:
sum.append(li2.pop(0))
return sum
@theoctober19th
theoctober19th / binary_search.c
Last active May 21, 2020 02:47
Code Golf Binary Search
#define i int
#define x return
i b(i*a,i k,i l,i r){i m=(l+r)/2;x a[m]==k?m:l>=r?-1:k<a[m]?b(a,k,l,m-1):b(a,k,m+1,r);}
@theoctober19th
theoctober19th / fibonacci.py
Last active May 13, 2020 14:30
Code golf for first 20 fibonacci numbers
a,b=0,1
for _ in range(20):
print(a)
a,b=b,a+b
@theoctober19th
theoctober19th / program.py
Created December 8, 2019 11:34
day shift ko gist
class Car():
def __init__(self, year):
self.year = year
def display(self):
print('i am inside parent')
class Tata(Car):
def __init__(self, year):
self.year = year
@theoctober19th
theoctober19th / program.py
Created December 8, 2019 05:22
First day of Bootcamp
class Car():
def __init__(self, name):
self.name = name
def display(self):
print(self.name)
class Tata(Car):
def __init__(self, name):
self.name = name