To use this with any API, just clone the Gist and run the following:
NGINX_API_URL=https://api.example.com API_PATH=/v0/openAPI docker-compose up
Finally browse to : http://docs.localhost:16640.
To use this with any API, just clone the Gist and run the following:
NGINX_API_URL=https://api.example.com API_PATH=/v0/openAPI docker-compose up
Finally browse to : http://docs.localhost:16640.
// Programme qui compte jusque l'infini | |
// Par Thomas et Nicolas Froidure Stiernon | |
const depart = Date.now(); | |
let compteur = 0; | |
while(true) { | |
if(Math.floor(Math.log10(compteur + 1)) > Math.floor(Math.log10(compteur))) { | |
console.log(compteur + 1, Math.round((Date.now() - depart) / 60000)); | |
} |
docker run \ | |
-v $(pwd)/pgsql/docs:/home/schcrwlr/share \ | |
--name schemacrawler \ | |
--rm -i -t \ | |
--entrypoint=/bin/bash schemacrawler/schemacrawler \ | |
-c "/opt/schemacrawler/schemacrawler.sh --command=schema --output-format=png --output-file=/home/schcrwlr/share/graph.png --server=postgresql --host=\$(/sbin/ip route|awk '/default/ { print \$3 }') --port=15432 --database=diagrams --schemas=public --user=postgres --password=mysecretpassword --info-level=maximum --log-level=ALL" |
<json:object> | |
<json:string name="text">Hello world!</json:string> | |
</json:object> |
import { Knifecycle, constant, autoService, service } from 'knifecycle'; | |
// Initialize the injector | |
const $ = new Knifecycle(); | |
// Declare constants | |
$.register(constant('FTP_CONFIG', { user: 'test', password: 'test' })); | |
$.register(constant('FTP_CONFIG2', { user: 'test2', password: 'test2' })); | |
// Declare services |
import { Knifecycle, constant, autoService, autoProvider } from 'knifecycle'; | |
// Initialize the injector | |
const $ = new Knifecycle(); | |
// Declare constants | |
$.register(constant('FTP_CONFIG', { user: 'test', password: 'test' })); | |
$.register(constant('DB_CONFIG', { user: 'test', password: 'test' })); |
tar tvf $(npm pack) |
function buildMessage(values) { | |
const DIFF = Math.pow(2, 9); // 512 | |
const MAX_PRECISION = 4; // 512 * 4 allows to encode 300 <= x <= 1100 | |
const maxIndex = values.indexOf(Math.max(...values)); | |
const minIndex = values.indexOf(Math.min(...values)); | |
const maxDiff = values.reduce( | |
(diff, v) => Math.max(v - values[minIndex], diff), | |
0 | |
); | |
const precision = Math.ceil(maxDiff / DIFF); |
package main | |
import ( | |
"bufio" | |
"fmt" | |
"log" | |
"math" | |
"os" | |
"path/filepath" | |
"strconv" |
import { getInstance, initializer } from 'knifecycle'; | |
import uuid from 'uuid'; | |
import { initDelayService } from 'common-services'; | |
import { | |
initRouter, | |
initHTTP, | |
initHTTPTransaction | |
} from 'swagger-http-router'; |