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
// SVELTE | |
import { derived, type Readable } from 'svelte/store'; | |
// FIREBASE | |
import { onAuthStateChanged } from 'firebase/auth'; | |
import type { Auth, User } from 'firebase/auth'; | |
// LIB | |
import { firebaseAuth } from '$lib/firebaseAuth'; | |
import { authEmitter } from '$lib/urqlClient'; | |
function newUserStore() { |
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
// URQL | |
import { makeOperation, fetchExchange } from '@urql/core'; | |
import { createClient } from '@urql/svelte'; | |
import { authExchange } from '@urql/exchange-auth'; | |
import type { ClientOptions, Operation } from '@urql/svelte'; | |
// MITT | |
import mitt from 'mitt'; | |
type AuthState = { | |
accessToken?: 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
#![allow(unused_variables)] | |
use anyhow::Result; | |
use flutter_rust_bridge::StreamSink; | |
#[derive(Debug, Clone)] | |
pub struct MySize { | |
pub width: i32, | |
pub height: i32, | |
} |
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 preprocess from 'svelte-preprocess'; | |
import adapter from '@sveltejs/adapter-static'; | |
/** @type {import('@sveltejs/kit').Config} */ | |
const config = { | |
// Consult https://github.com/sveltejs/svelte-preprocess | |
// for more information about preprocessors | |
preprocess: preprocess(), | |
kit: { |
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 preprocess from 'svelte-preprocess'; | |
import adapter from '@sveltejs/adapter-static'; | |
/** @type {import('@sveltejs/kit').Config} */ | |
const config = { | |
// Consult https://github.com/sveltejs/svelte-preprocess | |
// for more information about preprocessors | |
preprocess: preprocess(), | |
kit: { |
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 { parentPort, workerData } = require('worker_threads') | |
const bench = require('./bench') | |
// ════════════════════════════════════════════════════════════════════════════════════════════════╡ | |
parentPort.on('message', () => { | |
const result = bench(100) | |
parentPort.postMessage(result) |
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 http = require('http') | |
const { StaticPool } = require('node-worker-threads-pool') | |
const numCPUs = require('os').cpus().length | |
// ════════════════════════════════════════════════════════════════════════════════════════════════╡ | |
const host = '192.168.0.14' | |
const port = 8080 |
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 cluster = require('cluster') | |
const http = require('http') | |
const numCPUs = require('os').cpus().length | |
const bench = require('./bench') | |
// ════════════════════════════════════════════════════════════════════════════════════════════════╡ | |
const host = '192.168.0.14' |
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 http = require('http') | |
const bench = require('./bench') | |
const host = '192.168.0.14' | |
const port = 8000 | |
const start = function startServer() { | |
// Simple request router | |
const router = function requestRouter(request, reply) { | |
const result = bench(100) |
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
// ════════════════════════════════════════════════════════════════════════════════════════════════╡ | |
// ════════════════════════════════════════════════════════════════════════════════════════════════╡ | |
// Calculate Fibonacci sequence for num | |
function fib(n) { | |
if (n > 40) { | |
throw new TypeError('Fib: N is greater than 40.') | |
} | |
const s = [1] |
NewerOlder