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 folium | |
import requests | |
# Load IPs from a file | |
with open('ips.txt', 'r') as file: | |
ip_list = [line.strip() for line in file if line.strip()] | |
# Create a world map centered at latitude 0, longitude 0 | |
folium_map = folium.Map(location=[0, 0], zoom_start=2) |
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 | |
# | |
# Usage: curl-request METHOD PATH [DATA] | |
# | |
if [ "${XXX_TOKEN}" == "" ]; then | |
echo "Set XXX_TOKEN" | |
exit 1 | |
fi |
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
logging: | |
level: | |
com.example: DEBUG | |
org.springframework: INFO | |
file: ${spring.application.name}.log | |
path: /var/app_log/myapp/ |
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 org.example; | |
import org.slf4j.Logger; | |
import org.slf4j.LoggerFactory; | |
import org.springframework.cloud.gateway.filter.GatewayFilter; | |
import org.springframework.cloud.gateway.filter.factory.AbstractGatewayFilterFactory; | |
import org.springframework.cloud.gateway.support.ServerWebExchangeUtils; | |
import org.springframework.http.server.reactive.ServerHttpRequest; | |
import org.springframework.stereotype.Component; |
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
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>TITLE</title> | |
<base href="/"> | |
<script src="https://maps.googleapis.com/maps/api/js?key=<YOUR-API-KEY>"></script> | |
</head> | |
<body> |
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.util.List; | |
import java.util.concurrent.Callable; | |
import java.util.concurrent.ForkJoinPool; | |
import java.util.stream.Collectors; | |
import java.util.stream.LongStream; | |
public class ParallelStreamTest { | |
private static boolean verbose = false; | |
private static int size = 50; |
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 org.example.service; | |
import org.eclipse.jetty.server.Server; | |
import org.eclipse.jetty.servlet.ServletContextHandler; | |
import org.eclipse.jetty.servlet.ServletHolder; | |
import org.json.simple.JSONObject; | |
import org.json.simple.parser.JSONParser; | |
import org.junit.After; | |
import org.junit.Before; | |
import org.junit.Test; |
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 org.example.config; | |
import org.junit.Test; | |
import org.junit.runner.RunWith; | |
import org.springframework.beans.factory.annotation.Autowired; | |
import org.springframework.boot.test.context.SpringBootTest; | |
import org.springframework.boot.test.web.client.TestRestTemplate; | |
import org.springframework.test.context.junit4.SpringRunner; | |
import java.util.List; |
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
// Using two docker builds as a workaround until multiple tags are | |
// supported (https://github.com/Transmode/gradle-docker/issues/50). | |
task createDockerTasks() { | |
buildDockerWithTag('latest') | |
buildDockerWithTag(version) | |
} | |
task buildDocker(dependsOn: [createDockerTasks, buildDocker_latest, "buildDocker_${version}"]) { |
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.security.SecureRandom; | |
import java.util.Random; | |
public class RandomCodeGenerator { | |
static final SecureRandom RANDOM = new SecureRandom(); | |
static final char[] LETTERS = "ABCEFGHJKMNPQRSTWXYZ".toCharArray(); | |
static final char[] NUMBERS = "0123456789".toCharArray(); | |
static final int DEFAULT_NUM_CODES = 20; |
NewerOlder