This file contains hidden or 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
| let recorder = await navigator.mediaDevices | |
| .getUserMedia({ audio: true }) | |
| .then((mediaSourceObject) => { | |
| document.createElement("audio").srcObject = mediaSourceObject; | |
| const recorder = new MediaRecorder(mediaSourceObject); | |
| let data = []; | |
| recorder.ondataavailable = (e) => data.push(e.data); | |
| recorder.onstop = () => { | |
| const blob = new Blob(data, { type: "audio/ogg" }); | |
| data = []; |
This file contains hidden or 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
| # find #Figma plugin underdogs | |
| curl https://raw.githubusercontent.com/yuanqing/figma-plugins-stats/gh-pages/index.json > d.json | |
| node <<'EOF'|head -n 50 | |
| let d = require("./d.json"); | |
| let r = (p) => p.likeCount / p.installCount; | |
| d.plugins | |
| .sort((a, b) => r(b) - r(a)) | |
| .forEach((p, i) => console.log(`${i + 1}. ${p.name} by ${p.publisherName}`)); | |
| EOF |
This file contains hidden or 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
| <!DOCTYPE html> | |
| <html> | |
| <body> | |
| seeing the alert? | |
| <script src="main.js" type="module"></script> | |
| </body> | |
| </html> |
This file contains hidden or 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 Vue from "vue"; | |
| import { storiesOf } from "@storybook/vue"; | |
| import { action } from "@storybook/addon-actions"; | |
| import DropZone from "./DropZone.vue"; | |
| Vue.component("DropZone", DropZone); | |
| storiesOf("DropZone", module) | |
| .add("default", () => ({ |
This file contains hidden or 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
| package io.vertx.lang.scala.http | |
| import io.vertx.core.file.OpenOptions | |
| import io.vertx.scala.core.Vertx | |
| import io.vertx.scala.core.streams.Pump | |
| import org.junit.runner.RunWith | |
| import org.scalatest.concurrent.AsyncAssertions | |
| import org.scalatest.junit.JUnitRunner | |
| import org.scalatest.{FlatSpec, Matchers} |
This file contains hidden or 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
| var gulp = require('gulp'); | |
| gulp.task('sass', sassCompile); | |
| gulp.task('assets', assetCopy); | |
| gulp.task('scripts', scriptCompile); | |
| gulp.task('clean', clean); | |
| gulp.task('prepareAndReload', ['prepare'], reloader); | |
| gulp.task('prepare', ['default'], cordovaPrepare); | |
| gulp.task('dev', ['default'], liveReloadServer); |
This file contains hidden or 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 CreateHttpServer extends Verticle { | |
| def start(): Future[Unit] = { | |
| /* example-code-start */ | |
| vertx.createHttpServer(HttpServerOptions( | |
| host = "localhost", | |
| port = 8080 | |
| )).requestHandler(req => { | |
| req.response().setChunked(true).end("<html><body><h1>Hello from vert.x!</h1></body></html>"); | |
| }).listen(); |
This file contains hidden or 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 YourTest extends TestVerticle { | |
| // usual start(), etc. | |
| private void afterPostActionDo(Handler<HttpClient> nextFn) { | |
| final HttpClient client = vertx.createHttpClient().setHost("localhost").setPort(8080).setKeepAlive(false); | |
| HttpClientRequest req = httpClient.post("/someapi", new Handler<HttpClientResponse>() { | |
| public void handle(HttpClientResponse postResp) { | |
| // do something with postResp | |
| postResp.bodyHandler(new Handler<Buffer>() { | |
| public void handle(Buffer body) { | |
| // check body |
This file contains hidden or 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
| diff --git a/src/main/scala/org/vertx/scala/core/json/Json.scala b/src/main/scala/org/vertx/scala/core/json/Json.scala | |
| index d756a32..b6d32d5 100644 | |
| --- a/src/main/scala/org/vertx/scala/core/json/Json.scala | |
| +++ b/src/main/scala/org/vertx/scala/core/json/Json.scala | |
| @@ -17,51 +17,6 @@ | |
| import scala.annotation.implicitNotFound | |
| -@implicitNotFound(msg = "Cannot find add operations for type ${T}") | |
| -trait JsonElemOps[T] { |
This file contains hidden or 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
| package org.vertx.scala.core.eventbus | |
| import org.vertx.java.core.eventbus.EventBus | |
| import org.vertx.java.core.eventbus.Message | |
| class RichEventBus(internal: EventBus) extends EventBus { | |
| override def registerHandler[T <: Message[T]](address: String)(handler: T => Unit) = | |
| internal.registerHandler(address, handler) | |
| override def registerLocalHandler[T <: Message[T]](address: String)(handler: T => Unit) = |
NewerOlder