DoH queries resolve over HTTPS for privacy, performance, and security. DoH also makes it easier to use a name server of your choice instead of the one configured for your system.
08/16/17 by Sergey Grebenshchikov
This is a quick tutorial on how to test code using the GoMock mocking library and the standard library testing package testing
.
GoMock is a mock framework for Go. It enjoys a somewhat official status as part of the github.com/golang organization, integrates well with the built-in testing
package, and provides a flexible expectation API.
These days Linux supports a lot of devices. However, occasionally you will find a device that works but only for a while, requiring a reboot to work again. This is often due to the device itself not behaving according to the USB standard, and that's more often than not caused by misbehaving USB suspend.
The proper way of fixing this would be either a workaround in the driver or, God forbid, a fix in the device's firmware. But quite often nobody does anything, so what's left is to do the improper. And the easiest improper fix is to disable USB autosuspend.
For the command line, just add usbcore.autosuspend=-1
to GRUB_CMDLINE_LINUX_DEFAULT
:
sudo sed -i 's/GRUB_CMDLINE_LINUX_DEFAULT="[a-z ]*/& usbcore.autosuspend=-1/' /etc/default/grub
Go provides file-opening flags represented by constants defined in the os
package. These flags determine the behavior of file operations, such as opening, creating, and truncating files. The following is a list of the flags and what they do.
-
os.O_RDONLY
: Opens the file as read-only. The file must exist. -
os.O_WRONLY
: Opens the file as write-only. If the file exists, its contents are truncated. If it doesn't exist, a new file is created. -
os.O_RDWR
: Opens the file for reading and writing. If the file exists, its contents are truncated. If it doesn't exist, a new file is created.
.PHONY: help | |
## ENVIRONMENT VARIABLES | |
VERSION_FILE = release-candidate.txt | |
SEMVER ?= 0.1.0 | |
CURRENT_VERSION := $(shell [ -f $(VERSION_FILE) ] && cat $(VERSION_FILE) || echo $(SEMVER)) | |
# Self-Documented Makefile | |
# https://marmelab.com/blog/2016/02/29/auto-documented-makefile.html | |
help: | |
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' |
package dynscan | |
import ( | |
"database/sql" | |
"fmt" | |
"reflect" | |
"strings" | |
"time" | |
"github.com/google/uuid" |
<!doctype html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<script src="https://cdn.tailwindcss.com"></script> | |
<!-- FONTS --> | |
<link rel="preconnect" href="https://fonts.googleapis.com"> | |
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> |
package main | |
import "fmt" | |
func solution (seconds int) string { | |
if seconds == 0 { | |
return "now" | |
} |
package main | |
import "fmt" | |
func solution (n int, ratings [][]int) int { | |
dishRatings := make(map[int][2]int) | |
for i := 0; i < n; i++ { | |
dishID, rating := ratings[i][0], ratings[i][1] |