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 React, { ReactElement } from 'react' | |
import { Link, useSearchParams } from 'react-router-dom' | |
import { collection, getFirestore, orderBy } from 'firebase/firestore' | |
import { usePagedSnapshot } from './firestore-paging' | |
const comments = collection(getFirestore(), "comments") | |
const order = orderBy("createdAt", "desc") | |
export function CommentList(): ReactElement { |
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
resource "google_cloud_run_v2_service" "my_svc" { | |
name = "my-svc" | |
location = "asia-northeast1" | |
ingress = "INGRESS_TRAFFIC_ALL" | |
template { | |
containers { | |
image = "us-docker.pkg.dev/cloudrun/container/hello" | |
resources { | |
limits = { "cpu": "4000m", "memory" : "2Gi" } | |
} |
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
#include <thread> | |
#include <atomic> | |
#include <assert.h> | |
using namespace std; | |
static atomic<int> a = 0; | |
static atomic<int> b = 0; | |
static atomic<int> A = 0; | |
static atomic<int> B = 0; |
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 React, { ReactElement, useMemo } from "react" | |
import hljs from "highlight.js" | |
import 'highlight.js/styles/dark.css' | |
export function Code(props: { lang: string, text: string }): ReactElement { | |
const { value } = useMemo(() => | |
hljs.highlight(props.lang, trimMargin(props.text)), | |
[props.lang, props.text] | |
) | |
return <pre className="hljs"><code dangerouslySetInnerHTML={{ __html: value }} /></pre> |
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
#!/usr/bin/env ruby | |
LLVM_OBJDUMP = "objdump" | |
options = %w( | |
--no-leading-addr | |
--no-show-raw-insn | |
--symbolize-operands | |
--x86-asm-syntax=intel | |
) |
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
#!/usr/bin/env ruby | |
require "json" | |
# https://github.com/brendangregg/FlameGraph | |
FG_SCRIPTS = raise "`FG_SCRIPTS` must be set by hand." | |
if ARGV.empty? | |
$stderr.puts("Usage: ruby kperf.rb $POD [ $CONTAINER ] > out.svg") | |
exit(-1) |
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
require "mysql2" | |
require "pp" | |
def connect(iso: nil) | |
db = Mysql2::Client.new( | |
host: "127.0.0.1", | |
username: "root", | |
password: '', | |
database: 'test' | |
) |
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
{ | |
"clusters": [ | |
{ | |
"project": "<project-name>", | |
"name": "<cluster-name>", | |
"zone": "<cluster-zone>", | |
"nodePools": { | |
"my-node-pool-1": 0, | |
"my-node-pool-2": 1 | |
} |
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 React, { Component } from 'react' | |
import { Subscription } from 'rxjs'; | |
import Hls from "hls.js"; | |
type HlsJSPlayerProps = { | |
broadcastId: string | |
}; | |
type HlsJSPlayerState = {}; |
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
#!/usr/bin/env ruby | |
require 'timeout' | |
require 'rake' | |
CLOUD_DNS_ZONE = "..." | |
def cloud_dns(action, args = []) | |
sh "gcloud dns record-sets transaction #{action} --zone=#{CLOUD_DNS_ZONE} #{args.join(" ")}" | |
end |
NewerOlder