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(default_visibility = ["//visibility:public"]) | |
load("@io_bazel_rules_closure//closure:defs.bzl", "closure_js_binary") | |
load("@io_bazel_rules_closure//closure:defs.bzl", "closure_js_library") | |
# With the externs file as a source for the library | |
closure_js_library( | |
name = "foo", | |
srcs = [ | |
"foo.js", |
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_tools//tools/build_defs/docker:docker.bzl", "docker_build") | |
docker_build( | |
name = "hello", | |
base = "@official_ubuntu//image:image.tar", | |
cmd = ["echo", "hi"], | |
) |
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
// ==UserScript== | |
// @name RemoveOpenSearch | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description Prevent Chrome from automatically adding search engines. | |
// @author Joe Schafer | |
// @match http://*/* | |
// @grant none | |
// ==/UserScript== |
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
#!/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
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
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
#!/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
package main | |
import ( | |
"fmt" | |
"golang.org/x/text/runes" | |
"golang.org/x/text/transform" | |
"golang.org/x/text/unicode/norm" | |
"unicode" | |
) |