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
index 01ae821..bc0668e 100644 | |
--- a/folder_paths.py | |
+++ b/folder_paths.py | |
@@ -4,6 +4,7 @@ import os | |
import time | |
import mimetypes | |
import logging | |
+import datetime | |
from typing import Set, List, Dict, Tuple, Literal | |
from collections.abc import Collection |
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 in.silentsudo.springintegrations.jms; | |
import jakarta.jms.ConnectionFactory; | |
import lombok.extern.slf4j.Slf4j; | |
import org.springframework.beans.factory.annotation.Qualifier; | |
import org.springframework.boot.autoconfigure.jms.DefaultJmsListenerContainerFactoryConfigurer; | |
import org.springframework.context.annotation.Bean; | |
import org.springframework.context.annotation.Configuration; | |
import org.springframework.integration.annotation.ServiceActivator; | |
import org.springframework.integration.jms.ChannelPublishingJmsMessageListener; |
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
DELETE products | |
PUT products | |
{ | |
"mappings": { | |
"properties": { | |
"title": { | |
"type": "search_as_you_type" | |
} |
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
#!/bin/bash | |
# bash generate random alphanumeric string | |
# | |
# bash generate random 32 character alphanumeric string (upper and lowercase) and | |
NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1) | |
# bash generate random 32 character alphanumeric string (lowercase only) | |
cat /dev/urandom | tr -dc 'a-z0-9' | fold -w 32 | head -n 1 |
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
SELECT f.id as feed_id, u.name, u.email, | |
(select count(*) FROM jpatest.likes where feed_id = f.id) as likes_count, | |
(select count(*) FROM jpatest.comments where feed_id = f.id) as comments_count | |
FROM feeds f | |
LEFT JOIN users u | |
ON f.user_id = u.id | |
WHERE u.id = 12055; |
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
SELECT | |
id, | |
address, | |
(6371 * | |
ACOS(COS(RADIANS(12.972442)) * COS(RADIANS(latitude)) * COS(RADIANS(longitude) - | |
RADIANS(77.580643)) + SIN(RADIANS(12.972442)) * SIN(RADIANS(latitude)))) AS distance | |
FROM | |
address | |
HAVING distance < 5 | |
ORDER BY distance |
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
SELECT f.id, u.email, | |
count(distinct l.id) as likes_count, | |
count(distinct c.id) as comments_count | |
FROM feeds f | |
INNER JOIN users u ON f.user_id = u.id | |
INNER JOIN likes l on l.feed_id = f.id | |
left join comments c on c.feed_id = f.id | |
WHERE u.id = 12055 | |
group by f.id order by comments_count asc; |
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 examples; | |
import java.time.Duration; | |
import java.time.LocalTime; | |
import java.util.Arrays; | |
import java.util.List; | |
import java.util.concurrent.CompletableFuture; | |
import java.util.function.Supplier; | |
import java.util.stream.Collectors; |
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
cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w ${1:-32} | head -n 1 |
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
input { | |
twitter { | |
consumer_key => "${TWITTER_KEY}" | |
consumer_secret => "${TWITTER_SECRET}" | |
oauth_token => "${TWITTER_OAUTH_TOKEN}" | |
oauth_token_secret => "${TWITTER_OAUTH_SECRET}" | |
ignore_retweets => true | |
full_tweet => true | |
keywords=> ["java", "springboot"] | |
} |
NewerOlder