Python syntax here : 2.7 - online REPL
Javascript ES6 via Babel transpilation - online REPL
import math
// | |
// loads remote file using fetch() streams and "pipe" it to webaudio API | |
// remote file must have CORS enabled if on another domain | |
// | |
// mostly from http://stackoverflow.com/questions/20475982/choppy-inaudible-playback-with-chunked-audio-through-web-audio-api | |
// | |
function play(url) { | |
var context = new (window.AudioContext || window.webkitAudioContext)(); |
Python syntax here : 2.7 - online REPL
Javascript ES6 via Babel transpilation - online REPL
import math
{ | |
"AF": "Afghanistan", | |
"ZA": "Afrique du Sud", | |
"AL": "Albanie", | |
"DZ": "Algérie", | |
"DE": "Allemagne", | |
"AD": "Andorre", | |
"AO": "Angola", | |
"AI": "Anguilla", | |
"AQ": "Antarctique", |
{ | |
"$schema": "https://json-schema.org/draft-07/schema", | |
"additionalProperties": { | |
"$ref": "#/definitions/mecanismes/valeur" | |
}, | |
"definitions": { | |
"mecanismes": { | |
"variations": { | |
"title": "variations", | |
"markdownDescription": "Contient une liste de conditions (si) et leurs conséquences associées (alors), ainsi qu’un cas par défaut (sinon).\n\nPour la première condition vraie dans la liste, on retient la valeur qui lui est associée.\n\nSi aucune condition n’est vraie, alors ce mécanisme renvoie implicitement non.\n\nCe mécanisme peut aussi être utilisé au sein d’un autre mécanisme avec des attributs, tel que produit ou barème.\n\nDoc: https://publi.codes/docs/api/m%C3%A9canismes#variations", |
// | |
// creds.json is a service account json key | |
// | |
// -> always getting "The caller does not have permission" | |
// | |
var script = google.script('v1'); | |
var key = require('./creds.json'); | |
var jwtClient = new google.auth.JWT(key.client_email, null, key.private_key, ['https://www.googleapis.com/auth/spreadsheets'], null); |
{ | |
"$schema": "http://json-schema.org/draft-07/schema#", | |
"title": "scalingo.json schema https://doc.scalingo.com/platform/app/app-manifest", | |
"description": "Extracted from https://developers.scalingo.com/scalingo-json-schema/", | |
"type": "object", | |
"additionalProperties": false, | |
"properties": { | |
"$schema": { "type": "string" }, | |
"name": { | |
"description": "Complete name of the project", |
// LZW-compress a string | |
function lzw_encode(s) { | |
var dict = {}; | |
var data = (s + "").split(""); | |
var out = []; | |
var currChar; | |
var phrase = data[0]; | |
var code = 256; | |
for (var i=1; i<data.length; i++) { | |
currChar=data[i]; |
# | |
# https://publi.codes/studio/r%C3%A9sultat#prix%20paquet%3A%20%0A%20%20valeur%3A%2012%0A%20%20unit%C3%A9%3A%20%E2%82%AC%0A%0Aconsommation%20par%20jour%3A%0A%20%20question%3A%20Combien%20de%20cigarettes%20fumez-vous%20par%20jour%20en%20moyenne%20%3F%0A%20%20valeur%3A%208%0A%0Aeconomies%20par%20jour%3A%0A%20%20valeur%3A%20consommation%20par%20jour%20*%20(prix%20paquet%20%2F%2020)%0A%20%20unit%C3%A9%3A%20%E2%82%AC%0A%0Aeconomies%20par%20an%3A%0A%20%20valeur%3A%20economies%20par%20jour%20*%20365%0A%20%20unit%C3%A9%3A%20%E2%82%AC%0A%0Acommentaire%3A%0A%20%20variations%3A%0A%20%20%20%20-%20si%3A%20economies%20par%20an%20%3E%201500%0A%20%20%20%20%20%20alors%3A%20%22'Vous%20pourriez%20vous%20offrir%20un%20beau%20v%C3%A9lo%20%C3%A9l%C3%A9ctrique.'%22%0A%20%20%20%20-%20si%3A%20economies%20par%20an%20%3E%201000%0A%20%20%20%20%20%20alors%3A%20%22'Ca%20fait%20un%20beau%20petit%20voyage%20en%20Italie.'%22%0A%20%20%20%20-%20si%3A%20economies%20par%20an%20%3E%20500%0A%20%20%20%20%20%20alors%3A%20%22'Ca%20fait%20un%20tr%C3% |
create ~/verdaccio/conf/config.yaml from example then:
V_PATH=~/verdaccio; docker run -it --rm --name verdaccio \
-p 4873:4873 \
-v $V_PATH/conf:/verdaccio/conf \
-v $V_PATH/storage:/verdaccio/storage \
-v $V_PATH/plugins:/verdaccio/plugins \