Skip to content

Instantly share code, notes, and snippets.

View baybatu's full-sized avatar
🏠
Working from home

Batuhan Bayrakci baybatu

🏠
Working from home
View GitHub Profile
@baybatu
baybatu / attach-listener-to-push-method.js
Last active July 19, 2021 09:44
Attach event listener to Array push method call
var eventify = function(arr, callback) {
arr.push = function(e) {
Array.prototype.push.call(arr, e);
callback(arr);
};
};
var array = [1,2,3];
eventify(array, function(newArray) {
@baybatu
baybatu / yaml-cift-tirnak.md
Last active May 3, 2021 11:59
Iyi pratik ornegi olarak Yaml dosyalarinda cift tirnak kullanimi

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 / disable-vino-encryption.sh
Created August 13, 2018 06:37
Disable vino encryption on Ubuntu
gsettings set org.gnome.Vino require-encryption false
@baybatu
baybatu / use-local-pod-on-demo-project.md
Last active April 26, 2021 08:55
use local ios pod on a demo project

harray-ios-sdk projesini local'deki demo bir ios projesinde kullanabilmek icin adimlar:

  • localde bi ios projesi olustur (orn: batuiostest)
  • Kullanacagin modulun (harray-ios-sdk) kaynak kodlarini bu projenin icine kopyala
  • Ana dizinde Podfile olustur (ruby kodu icerecek) ve sunu koy:
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target 'batuiostest' do
@baybatu
baybatu / zalenium-vs-selenium-grid-archs.md
Last active April 19, 2021 07:48
simple zalenium vs selenium grid (w/o docker) architecture comparison

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 April 3, 2021 13:55
uniq aracinin sadece komsu satirlari tekillestirmesi / uniq tool makes only adjacent rows unique

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 April 1, 2021 06:09
Couchbase kismi guncelleme / Partial document update in Couchbase
@baybatu
baybatu / openj9-vs-oracle-jvm-benchmark-graph.md
Last active March 26, 2021 11:31
simple openj9 and oracle jvm benchmark

25 Sept 2019

jvmbench

@baybatu
baybatu / generate-random-data-sequence-presto.sql
Last active March 25, 2021 08:25
Generate random data using Presto
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 / next-execution-date-for-spring-cron-expressions.md
Last active March 14, 2021 04:18
Get next execution date for Spring cron expressions

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())