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
package duration | |
import ( | |
"encoding/json" | |
"fmt" | |
"time" | |
) | |
type Duration struct { | |
time.Duration |
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 | |
returnVal=() | |
convertArgsStrToArray() { | |
local concat="" | |
local t="" | |
returnVal=() | |
for word in $@; do | |
local len=`expr "$word" : '.*"'` |
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 | |
# for optional arguments: short - there can't be any spaces between the option and the argument | |
# long - the argument can only be passed by "=" | |
# parse options | |
OPTIONS=$(getopt -o o::r:n -l optional::,required:,none -n "$0" -- "$@") | |
# check result | |
[ $? -ne 0 ] && 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
#!/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
/* | |
CSS stylesheet is based on Kevin Burke's Markdown.css project: | |
http://kevinburke.bitbucket.org/markdowncss | |
For code highlighting: | |
<link rel="stylesheet" href="http://yandex.st/highlightjs/6.1/styles/magula.min.css"> | |
<script src="http://yandex.st/highlightjs/6.1/highlight.js"></script> | |
<script src="http://yandex.st/highlightjs/6.1/languages/cpp.min.js"></script> | |
<script>hljs.initHighlightingOnLoad();</script> | |
*/ |
NewerOlder