Vadim Ovcearenco
DevOps AWS Certified Specialist, AWS, GCO, Azure
Contact Information:
- Email: [email protected]
- Phone: +30 6942564900
Vadim Ovcearenco
DevOps AWS Certified Specialist, AWS, GCO, Azure
Contact Information:
const express = require('express') | |
const fs = require('fs') | |
const app = express() | |
const port = 3000 | |
app.use(express.json()) | |
app.get('/', (req, res) => { | |
fs.readFile('index.html', 'utf-8', (err, data) => { |
<?xml version="1.0" encoding="UTF-8"?> | |
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> | |
<xsl:template match="root"> | |
<root>HEY!!!</root> | |
</xsl:template> | |
</xsl:stylesheet> |
import sys | |
import BaseHTTPServer | |
from SimpleHTTPServer import SimpleHTTPRequestHandler | |
HandlerClass = SimpleHTTPRequestHandler | |
ServerClass = BaseHTTPServer.HTTPServer | |
Protocol = "HTTP/1.0" | |
if sys.argv[1:]: |
$(function(){ | |
window.TastypieCollection = Backbone.Collection.extend({ | |
parse: function(response) { | |
this.recent_meta = response.meta || {}; | |
return response.objects || response; | |
} | |
}); | |
window.TastypieModel = Backbone.Model.extend({ | |
base_url: function() { |
""" Wrapper for BaseHTTPServer.HTTPServer class. Runs server in other thread and allow | |
to stop and start server """ | |
from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler | |
import socket | |
import urllib2 | |
from threading import Thread | |
import time |
from datetime import datetime | |
import redis | |
import random | |
import sqlite3 | |
BROKER_HOST = "localhost" # Maps to redis host. | |
REDIS_PASSWORD = None | |
KEY_PREFIX = "speed_" | |
ALPHABETE = "qwertyuiopasdfghjklzxcvbnm1234567890QWERTYUIOPASDFGHJKLZXCVBNM" | |
SQLITE_DB = ":memory:" |
import threading | |
from task.models import Task | |
from django.test import TestCase | |
class TestThread(TestCase): | |
def test_run(self): | |
ts = [Job() for x in range(5)] | |
for t in ts: | |
t.start() |