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' | |
services: | |
mysql: | |
image: mysql | |
command: --default-authentication-plugin=mysql_native_password | |
environment: | |
MYSQL_ROOT_PASSWORD: root | |
ports: | |
- "3306:3306" | |
volumes: |
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 com.peeyush.common.utils; | |
import com.fasterxml.jackson.annotation.JsonInclude.Include; | |
import com.fasterxml.jackson.core.JsonGenerationException; | |
import com.fasterxml.jackson.core.JsonParseException; | |
import com.fasterxml.jackson.core.JsonProcessingException; | |
import com.fasterxml.jackson.core.type.TypeReference; | |
import com.fasterxml.jackson.databind.DeserializationFeature; | |
import com.fasterxml.jackson.databind.JsonMappingException; | |
import com.fasterxml.jackson.databind.JsonNode; |
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
class Main { | |
private final Map<Integer, Object> map = new ConcurrentHashMap<>(); | |
public Object getOnce(int idx) { | |
Object obj = map.get(idx); | |
if (obj == null) { | |
synchronized(this) { | |
obj = map.get(idx); | |
if (obj == null) { | |
obj = new Object(); |
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
-- @desc: Clamp a value between a min & max | |
-- @usage: redis-cli EVAL "$(cat SETCLAMP.lua)" 1 <key> <min> <max> | |
-- @return: clamped value | |
local function SETCLAMP(key, min, max) | |
local valStr = redis.call("GET", key) | |
if not valStr then return end | |
local val = tonumber(valStr) | |
if val > max then |
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
# Hello, and welcome to makefile basics. | |
# | |
# You will learn why `make` is so great, and why, despite its "weird" syntax, | |
# it is actually a highly expressive, efficient, and powerful way to build | |
# programs. | |
# | |
# Once you're done here, go to | |
# http://www.gnu.org/software/make/manual/make.html | |
# to learn SOOOO much more. |
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 ( | |
"fmt" | |
"net/http" | |
"time" | |
) | |
var urls = []string{ | |
"https://splice.com/", |