This file contains 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, render_template | |
from flask_sqlalchemy import SQLAlchemy | |
POSTGRES_URL= '127.0.0.1:5432' | |
POSTGRES_USER= 'postgres' | |
POSTGRES_PW = 'dbpw' | |
POSTGRES_DB = 'test' | |
SQLALCHEMY_DATABASE_URI = 'postgresql+psycopg2://{user}:{pw}@{url}/{db}'.format(user=POSTGRES_USER,pw=POSTGRES_PW,url=POSTGRES_URL,db=POSTGRES_DB) | |
SQLALCHEMY_TRACK_MODIFICATIONS = False | |
SQLALCHEMY_ECHO = True |
This file contains 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
#include<stdio.h> | |
//Function to calculate the maximum sum of a sub-array of a given array | |
int maxSumarray(int a[], int size){ | |
int i; | |
int max_sum_so_far=0; | |
int max_ending_here = 0; | |
for(i=0;i<size;i++){ | |
max_ending_here = max_ending_here + a[i]; | |
This file contains 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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
//Write a C# program to implement the below compress the given string using Run Length Algorithm | |
namespace RunLengthEncoder | |
{ | |
class Program |
This file contains 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
# Our Docker image will be based on ruby:2-slim | |
# it is a very light docker image. | |
FROM ruby:2-slim | |
LABEL author="Sujay Kundu" | |
LABEL version="1.0.0" | |
# Lets install all dependencies | |
# including git and Bundler 2.1.4 | |
ENV BUNDLER_VERSION 2.1.4 | |
RUN apt-get update && \ |
This file contains 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
#!/bin/python3 | |
import math | |
import os | |
import random | |
import re | |
import sys | |
def cycleStr(s): |
This file contains 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
'use strict'; | |
const fs = require('fs'); | |
process.stdin.resume(); | |
process.stdin.setEncoding('utf-8'); | |
let inputString = ''; | |
let currentLine = 0; | |
let res = ''; |
This file contains 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 express from 'express'; | |
import multer from 'multer'; | |
import Image from './../models/upload.model'; | |
const router = express.Router(); | |
// multer local storage | |
const storage = multer.diskStorage({ | |
destination: function (req, file, cb) { | |
cb(null, './uploads'); |
This file contains 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
/* Switch to Dark Mode Only */ | |
function modeSwitcher() { | |
sessionStorage.setItem('theme', 'dark'); | |
let theme = sessionStorage.getItem('theme'); | |
document.documentElement.setAttribute('data-theme', 'dark'); | |
} | |
$(document).ready(function () { | |
modeSwitcher(); | |
}); |
This file contains 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
// example test case | |
describe("Test Case Name", () => { | |
// Test case goes here | |
it("test case name", () => { | |
// cypress commands goes here | |
cy.visit("/"); |
NewerOlder