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 rulesDirPlugin = require("eslint-plugin-rulesdir"); | |
rulesDirPlugin.RULES_DIR = "eslint-rules"; | |
module.exports = { | |
rules: { | |
"rulesdir/no-link-prefetch": "error", | |
} | |
} |
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 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 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 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 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 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
local module = {} | |
worldview = module | |
module.Requests = module.Requests or {} | |
module.Rendering = false | |
function module.Request(id, renderData) | |
local t = module.Requests[id] | |
if not t then t={} module.Requests[id] = t end | |
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
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 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 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 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