Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Batuhan Bayrakci baybatu

🏠
Working from home
View GitHub Profile
@baybatu
baybatu / delete-redis-keys-by-pattern.md
Last active Apr 22, 2021
Delete Redis keys by pattern
View delete-redis-keys-by-pattern.md
@baybatu
baybatu / zalenium-vs-selenium-grid-archs.md
Last active Apr 19, 2021
simple zalenium vs selenium grid (w/o docker) architecture comparison
View zalenium-vs-selenium-grid-archs.md

Following diagram depicts Jenkins as the test runner. Zalenium Hub spawns docker containers that each one include target browsers that we want to run our test on.

zalenium_arch

@baybatu
baybatu / uniq-tekillestirme-yontemi.md
Last active Apr 3, 2021
uniq aracinin sadece komsu satirlari tekillestirmesi / uniq tool makes only adjacent rows unique
View uniq-tekillestirme-yontemi.md

uniq araci sadece komsu satirlari kullanarak tekillestirme yapar.

$ cat test.txt
a
a
a
b
b
c
@baybatu
baybatu / couchbase-partial-document-update.md
Last active Apr 1, 2021
Couchbase kismi guncelleme / Partial document update in Couchbase
View couchbase-partial-document-update.md
@baybatu
baybatu / generate-random-data-sequence-presto.sql
Last active Mar 25, 2021
Generate random data using Presto
View generate-random-data-sequence-presto.sql
select 5 from unnest(sequence(1, 6))
-- generates 6 row containing '5' as an example data
-- column
-- 5
-- 5
-- 5
-- 5
-- 5
-- 5
@baybatu
baybatu / yaml-cift-tirnak.md
Created Mar 20, 2021
Iyi pratik ornegi olarak Yaml dosyalarinda cift tirnak kullanimi
View yaml-cift-tirnak.md

Yaml dosyalarda yes, on, true gibi degerlerin hepsi boolean true degerine eslestiriliyor. Bu da gozden kactiginda tespiti zor buglara neden oluyor.

Bu tarz sorunlardan bastan kacinmak icin string alanlari cift tirnak ile cevrelemek iyi bir pratik.

Kotu ornek:

watermark:
  - no
  - yes
@baybatu
baybatu / limit-number.py
Created Jun 26, 2016
Limiting input number between minimum and maximum values range in Python
View limit-number.py
def limit(num, minimum=1, maximum=255):
"""Limits input 'num' between minimum and maximum values.
Default minimum value is 1 and maximum value is 255."""
return max(min(num, maximum), minimum)
@baybatu
baybatu / next-execution-date-for-spring-cron-expressions.md
Last active Mar 14, 2021
Get next execution date for Spring cron expressions
View next-execution-date-for-spring-cron-expressions.md

I usually use Groovy Console to run code below to get next execution date for Spring cron expressions.

new org.springframework.scheduling.support.CronSequenceGenerator("0 0/5 * * * *").next(new Date())
@baybatu
baybatu / flink-classnotfoundexception-fix.md
Last active Mar 11, 2021
Flink fix of java.lang.ClassNotFoundException: org.apache.flink.api.scala.typeutils.CaseClassTypeInfo
View flink-classnotfoundexception-fix.md