Skip to content

Instantly share code, notes, and snippets.

View bhawesh96's full-sized avatar

Bhawesh Bhansali bhawesh96

View GitHub Profile
#!/usr/bin/python
from flask import Flask, request
import requests
app = Flask(__name__)
@app.route("/")
def main():
return redirect("https://kite.zerodha.com/connect/login?v3&api_key=api_key_here")
@bhawesh96
bhawesh96 / yaksha_test_1.go
Created January 12, 2020 06:37
Multiples: GoLang!
package main
import ("fmt"
"errors"
"strconv"
)
func main() {
var n, m, i, j int
var stmnt string
var multiple_found bool
@bhawesh96
bhawesh96 / yaksha_test_1.py
Created January 12, 2020 04:50
Multiples!
n = int(input('Please enter the value of N: '))
if n <=0:
raise Exception('Value of N ({}) should be greater than 0'.format(n))
m = int(input('Please enter the value of M: '))
if m <=0:
raise Exception('Value of M ({}) should be greater than 0'.format(m))
n = int(input('Please enter the value of N: '))
if n <=0:
raise Exception('Value of N ({}) should be greater than 0'.format(n))
m = int(input('Please enter the value of M: '))
if m <=0:
raise Exception('Value of M ({}) should be greater than 0'.format(m))
@bhawesh96
bhawesh96 / tkinter.py
Created March 27, 2019 17:59
Snippet to demonstrate event callback for Entry() elements in Tkinter
from tkinter import *
root = Tk()
def callback(event):
print(event.widget.get())
e = Entry(root)
e.bind("<FocusOut>", callback)
e.grid()
@bhawesh96
bhawesh96 / Steps.MD
Last active January 23, 2019 15:47
Steps to install Python (2.7.9) in Windows

Steps to install Python v2.7.9 in Windows OS

  1. For a 64bit Windows machine, download the MSI installer here.
  2. Python v2.7.9 comes with pip. Hence, no need to explicitly install pip
  3. Time to set environment variables. Here's how you do it -
    1. In Search, search for and then select: System (Control Panel)
    2. Click the Advanced system settings link.
    3. Note the value of the PATH for your Python installation. (Generally C:\Python27). To be able to access pip from anywhere, we'll have to add C:\Python27\Scripts as well.
    4. Click Environment Variables. In the section System Variables, find the PATH environment variable and select it. Click Edit. If the PATH environment variable does not exist, click New.
  4. In the Edit System Variable (or New System Variable) window, specify the value of the PATH environment variable. Click OK. Close all remaining windows by clicking OK.
package com.example.bhawesh.vso.fragments;
import com.firebase.ui.database.FirebaseRecyclerAdapter;
import com.firebase.ui.database.FirebaseRecyclerOptions;
import com.google.firebase.database.DatabaseError;
import com.google.firebase.database.FirebaseDatabase;
import com.google.firebase.database.Query;
public class FaqFragment extends Fragment
{
from flask import Flask
import requests, json
app = Flask(__name__)
@app.route('/')
def home():
return "Hello world!"
@app.route('/encoded', methods=['POST'])
public class MainActivity extends AppCompatActivity {
Button button_camera;
ImageView image;
TextView desc;
public static final int REQUEST_CODE = 1;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
@bhawesh96
bhawesh96 / file.js
Created February 12, 2018 12:14
Form field validations
class SignupComponent extends Component {
constructor (props) {
super(props)
this.state = {
name: '',
username: '',
email: '',
phone_number: '',
password: '',
smsVerificationCode: '',