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
| /* | |
| HackerEarth | |
| https://www.hackerearth.com/practice/algorithms/string-algorithm/basics-of-string-manipulation/practice-problems/algorithm/aliceandstrings-9da62aa7/ | |
| */ | |
| #include <iostream> | |
| /* | |
| Recusrsively checks if string A can be converted to B by incrementing the prefixes: |
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 ubuntu:16.04 | |
| MAINTAINER pasanbox "pasanwijesinghe@gmail.com" | |
| RUN apt-get update -y && \ | |
| apt-get install -y python-pip python-dev | |
| # We copy just the requirements.txt first to leverage Docker cache | |
| COPY ./requirements.txt /app/requirements.txt |
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
| Flask==1.0.2 | |
| Flask-HTTPAuth==3.2.4 | |
| Flask-RESTful==0.3.7 | |
| requests==2.21.0 |
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
| Pasans-MacBook-Air:~ Pasan$ curl -u Alice:password -X GET http://127.0.0.1:5000/api/v1.0/isBad -d "name=Alfred" | |
| {"isBad":"True"} | |
| Pasans-MacBook-Air:~ Pasan$ curl -u Alice:password -X GET http://127.0.0.1:5000/api/v1.0/isBad -d "name=Radolf" | |
| {"isBad":"False"} |
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
| #!flask/bin/python | |
| from flask import Flask, jsonify | |
| from flask_restful import reqparse | |
| app = Flask(__name__) | |
| badDwarves = ['Adolf', 'Joker', 'Bond'] | |
| @app.route('/api/v1.0/isBad', methods=['GET']) | |
| def is_bad(): |
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
| #!flask/bin/python | |
| import requests | |
| from flask import Flask, jsonify | |
| from flask_httpauth import HTTPBasicAuth | |
| from flask_restful import reqparse | |
| auth = HTTPBasicAuth() | |
| app = Flask(__name__) | |
| badDwarves = ['Alfred', 'Sadam'] |
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
| $ git clone https://github.com/wso2/product-vick.git | |
| $ cd product-vick/samples/employee-portal/src/ | |
| $ tree . | |
| . | |
| ├── hr | |
| │ ├── Dockerfile | |
| │ ├── hrservice.bal | |
| ├── portal | |
| │ ├── employee | |
| │ │ ├── Dockerfile |
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 ballerina/io; | |
| import ballerina/config; | |
| import ballerina/log; | |
| import ballerina/mysql; | |
| import ballerina/sql; | |
| endpoint mysql:Client databaseConnector { | |
| host: "localhost", | |
| port: 3306, | |
| name: "github_issues", |