Skip to content

Instantly share code, notes, and snippets.

Batuhan Bayrakci baybatu

View GitHub Profile
baybatu /
Last active Jun 30, 2020
Excluding Directory From War Package In maven-war-plugin

packagingExcludes configuration tag can be used to exclude certain files or directories from the war file. It is important to put '/' character at the end of the directory to be excluded. If there is no such '/' character, then the entry is interpreted as a regular file.

baybatu /
Created Jun 26, 2016
Limiting input number between minimum and maximum values range in Python
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 / attach-listener-to-push-method.js
Last active Jun 12, 2020
Attach event listener to Array push method call
View attach-listener-to-push-method.js
var eventify = function(arr, callback) {
arr.push = function(e) {, e);
var array = [1,2,3];
eventify(array, function(newArray) {
baybatu /
Last active Jun 10, 2020
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"0 0/5 * * * *").next(new Date())
baybatu /
Last active Jun 9, 2020
RabbitMQ: mesajı geciktirerek tüketmek

RabbitMQ: Mesajı Geciktirerek Tüketmek

  • delay-exchange: Geciktirilecek mesajın bırakıldığı exchange.
  • delay-queue: delay-exchange'e bağlı. Herhangi bir tüketicisi olmamalı.
  • ana-exchange: Geciktirilmeden tüketilmek istenen mesajların bırakılabileceği exchange.
  • ana-queue: ana-exchange'e bağlı kuyruk. Tüketicisi var.

delay-queue şu parametrelerle oluşturulur:

  • x-dead-letter-exchange: -- boş
  • x-message-ttl: 3000 -- mesajın bekletileceği milisaniye
baybatu / get-domain-mapping-in-grails.groovy
Last active May 24, 2020
Getting mapping from domain class in Grails
View get-domain-mapping-in-grails.groovy
class Person {
Long id
String name
static mapping = {
table name: 'PERSON'
id column: 'PRS_ID'
name column: 'PRS_NAME'
baybatu /
Created Apr 10, 2020
Prevent clicking button automatically when press 'Enter' in Clarity
baybatu /
Created Mar 5, 2020 — forked from Bonno/
Opening multiple SSH sessions with iTerm automatically. To be used in an Automator flow.

Create a new Automater flow

Add 'Service'. Service receives 'no input' in 'iTerm'. Add 'Run AppleScript'.

baybatu /
Created Feb 25, 2020
Create spark session using hive metastore on local
SparkSession spark = SparkSession
.config("dfs.nameservices", "nameService01")
.config("hive.metastore.uris", "thrift://")
baybatu / string-to-number.js
Last active Feb 20, 2020
Converting string to number in Javascript (ES5)
View string-to-number.js
function toNumber(value) {
var convertedNumber = +value;
if (convertedNumber) {
return convertedNumber;
throw Error("Conversion error for value:" + value);
You can’t perform that action at this time.