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 ( | |
"encoding/json" | |
"fmt" | |
"os" | |
) | |
func bar() (int, error) { return 2, fmt.Errorf("testerr") } |
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
javascript:document.querySelectorAll("li section").forEach(s => s.innerHTML = s.innerHTML.replace(/(https:\/\/.*)/, "<a href='$1' target='_blank'>$1</a>")) |
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
// alt. https://github.com/kubernetes/apimachinery/blob/master/pkg/apis/meta/v1/duration.go | |
package duration | |
import ( | |
"encoding/json" | |
"fmt" | |
"time" | |
) | |
type Duration struct { |
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 | |
set -Eeuo pipefail | |
trap cleanup SIGINT SIGTERM ERR EXIT | |
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P) | |
usage() { | |
cat <<EOF | |
Usage: $(basename "${BASH_SOURCE[0]}") [-h] [-v] [-f] -p param_value arg1 [arg2...] |
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 python3 | |
import argparse | |
import os | |
import random | |
import shutil | |
import time | |
import warnings | |
import torch | |
import torch.nn as nn |
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
FROM ubuntu:18.04 | |
ENV LC_ALL=C.UTF-8 | |
ENV TERM=xterm | |
ADD http://devtools.dl.atlab.ai/docker/PRC-tz /etc/localtime | |
ADD https://github.com/krallin/tini/releases/download/v0.18.0/tini /usr/local/bin/tini | |
ADD https://github.com/tobert/pcstat/raw/2014-05-02-01/pcstat.x86_64 /usr/local/bin/pcstat | |
RUN chmod +x /usr/local/bin/tini && chmod +x /usr/local/bin/pcstat |
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 | |
FQDN=$1 | |
# make directories to work from | |
mkdir -p server/ client/ all/ | |
# Create your very own Root Certificate Authority | |
openssl genrsa \ | |
-out all/my-private-root-ca.privkey.pem \ | |
2048 |
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" | |
"regexp" | |
"strings" | |
) | |
const cueInfo = `FILE "01 遺サレタ場所:丁.wav" WAVE | |
TRACK 01 AUDIO |
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" | |
"io" | |
"io/ioutil" | |
"net" | |
"net/http" | |
"sync" | |
"time" |
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
// round down to multiple of 1024 | |
size_t roundDown(size_t s) { | |
return s & ~1023; | |
} | |
// round up to multiple of 1024 | |
size_t roundUp(size_t s) { | |
return (s + 1023) & ~1023; | |
} |
NewerOlder