Token (Authorization Bearer) authenication with a table holding the tokens.
GET /name HTTP/1.1
Authorization: Bearer foobar
Host: 0.0.0.0:8080
import Foundation | |
public protocol Stream: class { | |
var isClosed: Bool { get } | |
func close() throws | |
func setTimeout(_ timeout: Double) throws | |
} | |
public protocol ReadableStream: Stream { |
#!/usr/bin/env swift | |
print("This CLI updater is out of date.") | |
print("Please visit docs.qutheory.io or run") | |
print("the following command to update.") | |
print() | |
print("curl -sL toolbox.qutheory.io | bash") |
#!/bin/bash | |
if [[ "$(uname)" == "Linux" ]]; then | |
URL=https://swift.org/builds/swift-3.0-preview-1/ubuntu1404/swift-3.0-preview-1/swift-3.0-preview-1-ubuntu14.04.tar.gz | |
START=$(pwd) | |
cd $HOME | |
wget $URL -O - | tar xz | |
package com.hlprmnky.vapor_spring_benchmark; | |
import java.util.Arrays; | |
import java.util.List; | |
import java.util.Random; | |
import java.util.concurrent.atomic.AtomicLong; | |
import com.google.common.collect.ImmutableMap; | |
import org.springframework.beans.factory.annotation.Autowired; | |
import org.springframework.web.bind.annotation.RequestMapping; |
using System; | |
using System.IO; | |
using System.Linq; | |
using System.Reflection; | |
using Dapper; | |
using Microsoft.Data.Sqlite; | |
using Nancy; | |
namespace NancyVsVapor | |
{ |
package main | |
import ( | |
"encoding/json" | |
"flag" | |
"fmt" | |
"io" | |
"log" | |
"net/http" |
import sys | |
import flask | |
import random | |
import sqlite3 | |
import logging | |
import socket | |
logging.basicConfig(level=logging.WARNING, format='%(levelname)s: %(message)s') | |
app = flask.Flask(__name__) |
from django.conf.urls import url | |
from django.http import HttpResponse | |
from django.http import JsonResponse | |
from django.db import connection | |
def plaintext(request): | |
return HttpResponse('Hello, world') | |
def json(request): | |
return JsonResponse({ |
var cluster = require('cluster'); | |
if(cluster.isMaster) { | |
var cpuCount = require('os').cpus().length; | |
for(var i = 0; i < cpuCount; i += 1) { | |
cluster.fork(); | |
} | |
cluster.on('exit', function(worker) { |