This file contains hidden or 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/sh | |
name=$1 | |
if [[ -z "$name" ]]; then | |
echo "missing domain name argument" | |
exit 1 | |
fi | |
CADDYFILE=${CADDYFILE:-/etc/caddy/Caddyfile} |
This file contains hidden or 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
async function retry(n, fn, ...args) { | |
for (let i = 0; ; i++) { | |
try { | |
return await fn(...args); | |
} catch (e) { | |
if (i + 1 >= n) { | |
throw e; | |
} | |
await new Promise(r => setTimeout(r, (2**i) * 1000)); |
This file contains hidden or 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
cube_size = 20; | |
edge_bevel = 4; | |
corner_bevel = 4; | |
spacing = 0.4; | |
hinge_thickness = 8; | |
hinge_width = 10; | |
pillar_diameter = 4; |
This file contains hidden or 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" | |
"fmt" | |
"io" | |
"log" | |
"net" | |
"net/http" |
This file contains hidden or 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" | |
"log" | |
"io" | |
"math/rand" | |
"net/http" | |
"os/exec" | |
"sync" |
This file contains hidden or 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
@echo off | |
setlocal | |
set VPN_NAME=My VPN | |
rasphone -d "%VPN_NAME%" | |
rem find the interface id | |
for /f "delims=." %%i in ('route print ^| findstr "%VPN_NAME%"') do set IF_NUM=%%i |
This file contains hidden or 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 argparse | |
import os | |
import random | |
import time | |
import mxnet as mx | |
class TestNet(mx.gluon.Block): | |
def __init__(self, **kwargs): |
This file contains hidden or 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 | |
VERSION=151.0.0 | |
## Usage: | |
## curl https://gist.githubusercontent.com/ssttevee/924ee99937118227bbcdb23dacc27fdd/raw/semaphore_ci_gcloud_prepare.sh | sh | |
export PATH=$SEMAPHORE_CACHE_DIR/google-cloud-sdk/bin:$PATH | |
if [ ! -f "$SEMAPHORE_CACHE_DIR/google-cloud-sdk/bin/gcloud" ] |
This file contains hidden or 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 tests | |
// RESULTS | |
// | |
// Benchmark_Reveral_Buffer-4 3000000 507 ns/op | |
// Benchmark_Reveral_Concat-4 500000 3703 ns/op | |
// Benchmark_Reversal_Append-4 300000 4496 ns/op | |
import ( | |
"testing" |
This file contains hidden or 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 java.net.*; | |
import java.util.*; | |
public class SubnetAddresses { | |
public static void main(String[] args) throws UnknownHostException, SocketException { | |
// get all possible IP addresses of all LANs | |
Enumeration<NetworkInterface> nis = NetworkInterface.getNetworkInterfaces(); | |
while (nis.hasMoreElements()) { | |
// Get the next network interface |
NewerOlder