Skip to content

Instantly share code, notes, and snippets.

Avatar

Batuhan Bayrakci baybatu

View GitHub Profile
@baybatu
baybatu / prevent-form-submit-clarity.md
Created Apr 10, 2020
Prevent clicking button automatically when press 'Enter' in Clarity
View prevent-form-submit-clarity.md
@baybatu
baybatu / README.md
Created Mar 5, 2020 — forked from Bonno/README.md
Opening multiple SSH sessions with iTerm automatically. To be used in an Automator flow.
View README.md

Create a new Automater flow

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

@baybatu
baybatu / spark-session-for-local-with-hive.java
Created Feb 25, 2020
Create spark session using hive metastore on local
View spark-session-for-local-with-hive.java
SparkSession spark = SparkSession
.builder()
.appName("com.baybatu.sparkApp")
.master("local[*]")
.enableHiveSupport()
.config("dfs.nameservices", "nameService01")
.config("hive.metastore.uris", "thrift://10.20.30.40:8093")
.getOrCreate();
@baybatu
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);
}
@baybatu
baybatu / tcpdump-osx.sh
Created Feb 17, 2020
Getting network traffic of an application by PID on OSX
View tcpdump-osx.sh
sudo tcpdump -Q pid=PID -k
@baybatu
baybatu / java-ontanimli-kuralla-siralama.md
Created Dec 9, 2019
Java'da öntanımlı bir listeye göre sıralama yapmak
View java-ontanimli-kuralla-siralama.md
List<String> kurallar = Arrays.asList("ahmet", "veli", "mehmet");
List<String> sonuc = Arrays.asList("veli", "mehmet", "ahmet").stream()
  .sorted(Comparator.comparing(isim -> kurallar.indexOf(isim)))
  .collect(Collectors.toList());
assertThat(sonuc).isEqualTo(Arrays.asList("ahmet", "veli", "mehmet"));

Kaynak: https://stackoverflow.com/a/5245214

@baybatu
baybatu / twitterserver-admin-port.md
Last active Aug 29, 2019
Specifying admin port on TwitterServer
View twitterserver-admin-port.md

Pass following as program an argument

java -jar app.jar -admin.port=:9999
You can’t perform that action at this time.