This file contains 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 * as React from "react"; | |
import { promises as fs } from "fs"; | |
import * as myDesignSystem from "my-design-system"; | |
import { LiveProvider, LiveError, LivePreview, LiveContext } from "react-live"; | |
import dynamic from "next/dynamic"; | |
let monaco: any = undefined; | |
const MonacoEditor: typeof import("react-monaco-editor").default = | |
(typeof global.window === 'undefined') ? undefined : dynamic(import("react-monaco-editor") | |
.then((mod) => { |
This file contains 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
const typescript = require("typescript"); | |
const path = require("path"); | |
module.exports = (_) => (transformationContext) => (sourceFile) => { | |
function visitNode(node) { | |
if (shouldMutateModuleSpecifier(node)) { | |
const factory = transformationContext.factory; | |
if (typescript.isImportDeclaration(node)) { | |
const newModuleSpecifier = factory.createStringLiteral(`${node.moduleSpecifier.text}.mjs`); | |
node = factory.updateImportDeclaration(node, node.decorators, node.modifiers, | |
node.importClause, newModuleSpecifier, node.assertClause); |
This file contains 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
/** | |
* Reads a string from the memory table. | |
* When a web assembly returns a string, javascript only sees the pointer | |
* to the memory table, and has to read the value from the table. | |
* | |
* @param instance web assembly program instance (memory + code) | |
* @param pointer where does the string start in the memory table | |
* @returns a slice of the memory table starting from pointer and ending before \0 | |
*/ | |
export const getString = (instance: WebAssembly.Instance, pointer: number): string => { |
This file contains 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 * as React from "react"; | |
import { promises as fs } from "fs"; | |
import { resolve } from "path"; | |
import matter from "gray-matter"; | |
import { MDXRemote } from "next-mdx-remote"; | |
import { serialize } from "next-mdx-remote/serialize"; | |
type PageProps = { documentProps: { | |
menu: Record<string, string>[]; | |
frontMatter: { |
This file contains 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 com.company.service.configuration | |
import com.google.protobuf.MessageLite | |
import io.grpc.BindableService | |
import io.grpc.Channel | |
import io.grpc.netty.NettyChannelBuilder | |
import io.netty.handler.ssl.ApplicationProtocolConfig | |
import io.netty.handler.ssl.ApplicationProtocolConfig.Protocol.ALPN | |
import io.netty.handler.ssl.ApplicationProtocolConfig.SelectedListenerFailureBehavior.ACCEPT | |
import io.netty.handler.ssl.ApplicationProtocolConfig.SelectorFailureBehavior.NO_ADVERTISE |
This file contains 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 com.mycompany.react | |
import org.w3c.dom.html.HTMLElement | |
import java.lang.reflect.InvocationHandler | |
import java.lang.reflect.Method | |
import java.lang.reflect.Proxy | |
import kotlin.reflect.KClass | |
import kotlin.reflect.KType | |
import kotlin.reflect.full.createType | |
import kotlin.reflect.full.isSubtypeOf |
This file contains 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 com.mycompany.library.tools | |
import org.springframework.boot.env.YamlPropertySourceLoader | |
import org.springframework.core.env.ConfigurableEnvironment | |
import org.springframework.core.env.Profiles | |
import org.springframework.core.io.ClassPathResource | |
object LoadYaml { | |
data class LoadOptions( |
This file contains 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 com.mycompany.infra.config | |
import kotlinx.coroutines.CoroutineExceptionHandler | |
import kotlinx.coroutines.CoroutineScope | |
import kotlinx.coroutines.Deferred | |
import kotlinx.coroutines.async | |
import kotlinx.coroutines.channels.Channel | |
import kotlinx.coroutines.channels.ReceiveChannel | |
import kotlinx.coroutines.channels.SendChannel | |
import kotlinx.coroutines.coroutineScope |
This file contains 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 io.mockk.every | |
import io.mockk.mockk | |
import java.sql.* | |
import java.time.ZonedDateTime | |
import javax.sql.DataSource | |
object DatabaseSimulator { | |
val registeredSQLServerMappings = mutableMapOf<String, ResultSet>() | |
val calledStatements = mutableListOf<String>() |
This file contains 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
{"weightsAndBiases":[[{"bias":-0.10071499664092819,"weights":[]},{"bias":-0.15018810063963497,"weights":[]}],[{"bias":-2.8468035812909434,"weights":[5.45721869905237,-3.148199059174658]},{"bias":-5.242078727744964,"weights":[-3.3284653639142725,10.876261776883684]},{"bias":-12.976066169035779,"weights":[36.003431279150426,6.242494143417826]},{"bias":-20.989904892589315,"weights":[13.402075212498223,51.79564730855186]}],[{"bias":-5.425858592065819,"weights":[-58.58740543154484,-32.269696973037284,18.54140361818438,10.084452534168838]}]],"parameters":["x","y"],"theory":"x^2+y^2<1","layersLength":[2,4,1]} |