π―
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask import Flask, jsonify, request | |
from flask_sqlalchemy import SQLAlchemy | |
import uuid | |
app = Flask(__name__) | |
db = SQLAlchemy(app) | |
app.config['SECRET_KEY']='secret' | |
app.config['SQLALCHEMY_DATABASE_URI']='sqlite:///app.db' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import graphene | |
import json, csv | |
from datetime import datetime | |
from flask import Flask | |
from flask_graphql import GraphQLView | |
app = Flask(__name__) | |
class User(graphene.ObjectType): | |
id = graphene.ID() |
Steps to deploy a Node.js app to DigitalOcean using PM2, NGINX as a reverse proxy and an SSL from LetsEncrypt
If you use the referal link below, you get $10 free (1 or 2 months) https://m.do.co/c/5424d440c63a
I will be using the root user, but would suggest creating a new user
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function walkPreTree(curr: BinaryNode<number> | undefined, path: number[]): number[] { | |
if (!curr) return path | |
path.push(curr.value) | |
walkPreTree(curr.left, path) | |
walkPreTree(curr.right, path) | |
return path | |
} | |
function walkInTree(curr: BinaryNode<number> | undefined, path: number[]): number[] { | |
if (!curr) return path |
Project: Simple Bank Application
Problem Statement:
You are tasked with building a simple bank application in Java that allows users to create bank accounts, view account details, deposit, withdraw, and transfer money between accounts. You should also implement a Bank
class to manage these accounts.
Class Structure:
- Bank Class:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { createStore } from 'redux' | |
type OPEN_MODAL = { | |
type: 'OPEN_MODAL' | |
modal_type: string | |
} | |
type CLOSE_MODAL = { | |
type: 'CLOSE_MODAL' | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
) | |
func Sqrt(x float64) float64 { | |
guess := 1.0 | |
var lastGuess float64 | |
var lastTwoGuess float64 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def getInput(availablePositions): | |
print("Available positions ππ½") | |
print(availablePositions) | |
rowIdx = int(input('Which row are you playing? ')) | |
colIdx = int(input('Which column are you playing? ')) | |
while [rowIdx, colIdx] not in availablePositions: | |
print("Position not available") | |
getInput(availablePositions) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import boto3, os | |
class PyS3: | |
def __init__(self, ACCESS_KEY, SECRET_KEY): | |
self.s3 = boto3.resource('s3', aws_access_key_id=ACCESS_KEY, aws_secret_access_key=SECRET_KEY) | |
def allow_or_prevent_public_access(self, bucket_name, secure=False): | |
try: | |
self.s3.meta.client.put_public_access_block( | |
Bucket=bucket_name, |
OlderNewer