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 ( | |
| "log" | |
| "bufio" | |
| "time" | |
| "os" | |
| "fmt" | |
| "io" | |
| "net" |
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
| func download(id string, db *sql.DB) { | |
| fmt.Printf("Downloading %s\n", id) | |
| //nejde pretoze namiesto $ sa da null alebo nejaky shit pretoze nic nematchuje | |
| rows, err := db.Query(`select post_id || '.html', structured_text from post_translation pt | |
| join post_translation_structured_text t on t.id = pt.id | |
| where post_id = $1 and language_key = 'en'`, id) | |
| //ale toto ide, ked je tam pasnuta konstanta... | |
| rows, err := db.Query(`select post_id || '.html', structured_text from post_translation pt | |
| join post_translation_structured_text t on t.id = pt.id |
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 javax.servlet.http.HttpServletRequest; | |
| import javax.servlet.http.HttpServletResponse; | |
| import javax.ws.rs.container.DynamicFeature; | |
| import javax.ws.rs.container.ResourceInfo; | |
| import javax.ws.rs.core.Context; | |
| import javax.ws.rs.core.FeatureContext; | |
| import javax.ws.rs.ext.Provider; | |
| import java.lang.reflect.Method; | |
| /** |
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 org.slf4j.Logger; | |
| import org.slf4j.LoggerFactory; | |
| import org.springframework.boot.autoconfigure.EnableAutoConfiguration; | |
| import org.springframework.boot.autoconfigure.security.servlet.UserDetailsServiceAutoConfiguration; | |
| import org.springframework.http.HttpMethod; | |
| import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; | |
| import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity; | |
| import org.springframework.security.config.annotation.web.builders.HttpSecurity; | |
| import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; | |
| import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; |
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
| DROP TABLE IF EXISTS pgbench_generic_log; | |
| CREATE TABLE pgbench_generic_log ( | |
| mtime timestamptz not null default now(), | |
| action char not null check (action in ('I', 'U', 'D')), | |
| username text not null, | |
| table_name text not null, | |
| row_data jsonb not null | |
| ); | |
| CREATE INDEX ON pgbench_generic_log USING brin (mtime); |
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
| try (final var client = AdminClient.create(Map.of(CommonClientConfigs.BOOTSTRAP_SERVERS_CONFIG, "localhost:9092"))) { | |
| final var groupIds = client.listConsumerGroups().all().get(). | |
| stream().map(ConsumerGroupListing::groupId).collect(Collectors.toList()); | |
| //get groups | |
| final var groups = client. | |
| describeConsumerGroups(groupIds).all().get(); | |
| //search for topics with members | |
| final var topicsWithMembers = new HashSet<String>(); |