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
| const { spawn } = require("child_process"); | |
| const path = require("path"); | |
| const readline = require("readline"); | |
| const os = require("os"); | |
| const fs = require("fs"); | |
| // ── config ────────────────────────────────────────────── | |
| const SCAN_DIR = process.env.SCAN_DIR || path.join(".", "scans"); | |
| const SCAN_FORMAT = "png"; | |
| const SCAN_DPI = 300; |
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
| const rulesDirPlugin = require("eslint-plugin-rulesdir"); | |
| rulesDirPlugin.RULES_DIR = "eslint-rules"; | |
| module.exports = { | |
| rules: { | |
| "rulesdir/no-link-prefetch": "error", | |
| } | |
| } |
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 crypto from "crypto"; | |
| import { StepOpts } from "inngest/types"; | |
| const CRYPTO_KEY = process.env.BACKGROUND_VAR_CRYPTO_KEY; | |
| export type Encrypted<T> = { | |
| iv: string; | |
| ciphertext: string; | |
| }; |
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
| name: Deploy serverless functions | |
| on: | |
| push: | |
| paths: | |
| - "functions/**" | |
| branches: | |
| - "main" | |
| jobs: | |
| list-functions: | |
| runs-on: ubuntu-latest |
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
| // src https://github.com/google/codemirror-mode-jsonnet | |
| const jsonnet: any = { | |
| token: function (stream, state) { | |
| // Handle special states: | |
| // In a C-style comment | |
| if (state.cComment) { | |
| if (stream.match(/\*\//)) { | |
| state.cComment = false; | |
| return "comment"; |
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 * as pulumi from '@pulumi/pulumi' | |
| import * as gcp from '@pulumi/gcp' | |
| import * as k8s from '@pulumi/kubernetes' | |
| export class CloudSQLAccount { | |
| readonly serviceAccount: gcp.serviceaccount.Account | |
| readonly serviceAccountKey: gcp.serviceaccount.Key | |
| readonly credentialsSecret: k8s.core.v1.Secret |
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 TabCountSync { | |
| constructor() { | |
| this.bc = new BroadcastChannel("tabcount-sync"); | |
| this.bc.postMessage("opened"); | |
| this.bc.onmessage = (ev) => this.onMessage(ev); | |
| this.count = 1; | |
| this.subscriptions = new Set(); | |
| } |
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
| function cofetch(url, headers) | |
| local co = coroutine.running() | |
| assert(co) | |
| -- ensure we wait at least one tick | |
| timer.Simple(0, function() | |
| http.Fetch(url, function(body, size, headers, code) | |
| coroutine.resume(co, body, size, headers, code) | |
| end, function(err) | |
| coroutine.resume(false, err) |
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
| # Run REPL | |
| iex -S mix |
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
| # Delay of 200ms per frame; remove transparent background and fill with white; loop | |
| convert -delay 20 -alpha remove -background white *.png -loop 0 navmesh_weights.gif |
NewerOlder