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
load("@bazel_skylib//rules:build_test.bzl", "build_test") | |
load("@rules_foreign_cc//tools/build_defs:configure.bzl", "configure_make") | |
"""An openssl build file based on a snippet found in the github issue: | |
https://github.com/bazelbuild/rules_foreign_cc/issues/337 | |
""" | |
# Read https://wiki.openssl.org/index.php/Compilation_and_Installation | |
CONFIGURE_OPTIONS = [ |
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
-- create_temporal_past_table creates a new table with the same structure | |
-- as the current table. Adds triggers to copy all changed or deleted rows | |
-- from the current table to the past table. | |
CREATE PROCEDURE admin.create_temporal_past_table(curr_tbl regclass, past_tbl text) AS $fn$ | |
DECLARE | |
curr_tbl_qual text := simc.quote_regclass(curr_tbl); | |
past_tbl_schema text := (parse_ident(past_tbl))[1]; | |
past_tbl_name text := (parse_ident(past_tbl))[2]; | |
past_tbl_qual text := quote_ident(past_tbl_schema) || '.' || quote_ident(past_tbl_name); |
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
# We append the integers 1..50 to a base prefix. | |
# The problematic strings have the apostrophe \xe2 | |
# Andy’s liqour parent account | |
# Carr’s Bar N’ Grill | |
short dest error transforming unicode to ascii src_bytes="wind-Andy\xe2" src_bytes_read=10, dst_bytes="wind-And\x00\x00" dst_bytes_written=8: transform: short destination buffer | |
short dest error transforming unicode to ascii src_bytes="wind-Andy\xe21" src_bytes_read=11, dst_bytes="wind-And\x00\x00\x00" dst_bytes_written=8: transform: short destination buffer ... | |
... | |
short dest error transforming unicode to ascii src_bytes="wind-Andy\xe246" src_bytes_read=12, dst_bytes="wind-Andy\x00\x00\x00" dst_bytes_written=9: transform: short destination buffer | |
short dest error transforming unicode to ascii src_bytes="wind-Andy\xe247" src_bytes_read=12, dst_bytes="wind-Andy\x00\x00\x00" dst_bytes_written=9: transform: short destination buffer |
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 main | |
import ( | |
"fmt" | |
"golang.org/x/text/runes" | |
"golang.org/x/text/transform" | |
"golang.org/x/text/unicode/norm" | |
"unicode" | |
) |
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
#!/bin/zsh | |
function port-kill() { | |
local port="$1" | |
local pids | |
# Simplest way to fill an array from a command. The results are whitespace | |
# safe. | |
# shellcheck disable=SC2207 | |
pids=( $(lsof -t -i:"${port}") ) | |
if [[ "${#pids[@]}" == 0 ]]; then |
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 type { Dispatch, SetStateAction } from 'react'; | |
import { useCallback, useRef, useState } from 'react'; | |
/** The returned value of a useRef hook, but marked as readonly. */ | |
type ReadOnlyRef<T> = { | |
readonly current: T; | |
}; | |
/** The return type of useStateRef. */ | |
type StateRefResult<S> = [S, Dispatch<SetStateAction<S>>, ReadOnlyRef<S>]; |
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 machine = Machine({ | |
id: 'activeProduct', | |
initial: 'pristine', | |
strict: true, | |
context: { | |
name: {}, // product resource name | |
product: {}, // current active product | |
dirtyProduct: {}, // locally modified fields not yet submitted | |
submittingProduct: {}, // fields currently being submitted | |
seqSubmitFails: 0, // number of sequential submit failures |
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 bash | |
function symlink_to_dir() { | |
local target="$2" | |
mkdir -p "$target" | |
if [[ -f "$1" ]]; then | |
ln -s -f -t "$target" "$1" | |
elif [[ -L "$1" ]]; then | |
cp $1 $2 | |
elif [[ -d "$1" ]]; then | |
local children=$(find -H "$1" -maxdepth 1 -mindepth 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
#!/bin/bash | |
set -e | |
# Workaround old docker images with incorrect $HOME | |
# check https://github.com/docker/docker/issues/2968 for details | |
if [ "${HOME}" = "/" ] | |
then | |
export HOME=$(getent passwd $(id -un) | cut -d: -f6) | |
fi |
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 main | |
// Simple, single-threaded server using system calls instead of the net library. | |
// | |
// Omitted features from the go net package: | |
// | |
// - TLS | |
// - Most error checking | |
// - Only supports bodies that close, no persistent or chunked connections | |
// - Redirects |
NewerOlder