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
# [googleadservices.com] | |
0.0.0.0 googleadservices.com | |
0.0.0.0 pagead2.googleadservices.com | |
0.0.0.0 www.googleadservices.com |
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 -S gawk -f | |
# for MACOS: brew install gawk | |
# https://gist.github.com/yermulnik/7e0cf991962680d406692e1db1b551e6 | |
# Tested with GNU Awk 5.0.1, API: 2.0 (GNU MPFR 4.0.2, GNU MP 6.2.0) | |
# Usage: cat variables.tf | awk -f /path/to/tf_vars_sort.awk | tee sorted_variables.tf | |
# No licensing; yermulnik@gmail.com, 2021-2022 | |
{ | |
# skip blank lines at the beginning of file | |
if (!resource_type && length($0) == 0) next |
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
// Resource: https://zetcode.com/golang/find-file/ | |
package main | |
import ( | |
"fmt" | |
"log" | |
"os" | |
"path/filepath" | |
"regexp" | |
) |
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 ( | |
"context" | |
"flag" | |
"log" | |
"path/filepath" | |
"testing" | |
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" |
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
version: '3.4' | |
services: | |
zookeeper: | |
image: confluentinc/cp-zookeeper:latest | |
environment: | |
ZOOKEEPER_CLIENT_PORT: 2181 | |
ZOOKEEPER_TICK_TIME: 2000 | |
ZOOKEEPER_INIT_LIMIT: 5 | |
ZOOKEEPER_SYNC_LIMIT: 2 |
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
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: nginx-deployment | |
labels: | |
app: nginx-jsmdg | |
spec: | |
replicas: 3 | |
selector: | |
matchLabels: |
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 ( | |
"context" | |
kafka "github.com/segmentio/kafka-go" | |
log "github.com/sirupsen/logrus" | |
"time" | |
) | |
type Config 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
# Assumption tensor == np.array | |
def print_tensor(tensor): | |
for i3 in range(0, tensor.shape[0]): | |
for i1 in range(0, tensor.shape[2]): | |
string_line = "" | |
for i2 in range(0, tensor.shape[1]): | |
string_line += " {:3.2f} ".format(tensor[i3][i2][i1]) | |
print(string_line) | |
print("------------------------------------") |
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
template<typename T> | |
std::array<T,3> index_3D(T index, T size) { | |
T x = index % size; | |
T tmp = (index - x) / size; | |
T y = tmp % size; | |
T z = (tmp - y) / size; | |
return std::array<T,3>{z,y,x}; | |
} |
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
#poisson solver | |
#u_xx = b(x) | |
%matplotlib inline | |
from __future__ import division | |
import numpy as np | |
from numpy import cos, sin, zeros, pi | |
from numpy.linalg import solve, norm | |
import matplotlib.pyplot as plt | |
from matplotlib import rcParams | |
NewerOlder