If some lost soul is searching for a way to validate a json schema in NativeScript, the only plugin that I found to work is tv4
(https://github.com/geraintluff/tv4)
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 os, logging, sys | |
if os.getenv('LAMBDA_TASK_ROOT', None): # check if we are in lambda | |
# add the current folder to the path of python | |
# assumes that during build time we installed in the current folder packages from a, say, requirements.txt | |
# we need this so that our packages are found before the already existing ones in the lambda environment | |
print("setting the path when in lambda") | |
curr_file_dir_path = os.path.dirname(os.path.abspath(__file__)) | |
print(curr_file_dir_path) | |
sys.path.insert(0, curr_file_dir_path) |
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
{ | |
// See https://go.microsoft.com/fwlink/?LinkId=733558 | |
// for the documentation about the tasks.json format | |
"version": "2.0.0", | |
"tasks": [ | |
{ | |
"label": "validate-template", | |
"type": "shell", | |
"windows": { | |
"command": "aws" |
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
class SomeClass { | |
public a; | |
public b; | |
constructor() { | |
this.a = '1'; | |
this.b = [] | |
} | |
one = () => { | |
console.log(`one = () => {} ${this.a}`) | |
this.b.push('one') |
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
def print_object_attrs(obj): | |
print("%s:" % obj.__name__) | |
for name, value in [(v, getattr(obj, v)) for v in obj.__dict__ if not v.startswith('__')]: | |
print("%s=%s" % (name, value)) |
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 datetime import datetime as dt, timedelta as td | |
def datetime_range(start, end, step): | |
assert end >= start, "The end date should be after in time than the start. End: {end} Start:{start}".format(end=end, | |
start=start) | |
i = 0 |
./thesis
├── docker-compose.yaml
├── micrsoserviceX
├── micrsoserviceY
├── memory-engine
Adapted from here. Below is an executive summary for the use case of a university collaborative thesis project.
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 threading | |
from requests import get | |
import queue | |
from datetime import datetime as dt | |
# Given a csv file with domain names, retrieve the content of the webpage, and given a predicate, add the domain name to a result set if the | |
# response from the passes the check of the predicate. | |
# Results are written to a timestamped file in the same directory of the script. | |
### Predicates | |
# Given a requests.Response object return True if the URL should be added to the result |
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 unittest | |
from unittest import TestCase | |
""" | |
Showcase how to use mixins and multiple inheritance to write tests | |
""" | |
class BaseTest(TestCase): | |
""" | |
A base class to be inheritated by actuall test classes. | |
""" | |
def setUp(self): # 3 |
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
j = 8 | |
for j in range(1, j+1): # [1..j] # from 1 to j, including j | |
for i in range(j-2, 0-1, -1): # from j-2 "downto" 0; including 0 | |
for k in range(i+1, j-1+1): # [i .. j-1] from i to j-1, including j-1 | |
print("(j=%s,i=%i,k=%s)"%(j,i,k)) |
NewerOlder