Skip to content

Instantly share code, notes, and snippets.

View 0guzhan's full-sized avatar

Oguzhan Acargil 0guzhan

  • Amsterdam
  • 06:34 (UTC +02:00)
View GitHub Profile
@0guzhan
0guzhan / android_emu_setup.sh
Created May 5, 2025 00:40
Download the latest Android platform tools & command line tools
# Download the latest Android platform tools & command line tools
# Create a directory for Android SDK
export ANDROID_HOME=$HOME/Android/Sdk
mkdir -p $ANDROID_HOME
# Download command line tools
CMD_TOOLS_ZIP_URL="https://dl.google.com/android/repository/commandlinetools-linux-9477386_latest.zip"
wget -O /tmp/cmdline-tools.zip $CMD_TOOLS_ZIP_URL
# Unzip command line tools to the home directory
unzip /tmp/cmdline-tools.zip -d /tmp
rm /tmp/cmdline-tools.zip
export ANDROID_HOME="$HOME/Android/Sdk"
export ANDROID_SDK_ROOT="$ANDROID_HOME"
export ANDROID_AVD_HOME="$HOME/.android/avd"
export ANDROID_EMULATOR_HOME="$HOME/.android"
export PATH="$PATH:$ANDROID_HOME/emulator"
export PATH="$PATH:$ANDROID_HOME/tools"
#export PATH="$PATH:$ANDROID_HOME/tools/bin"
export PATH="$PATH:$ANDROID_HOME/platform-tools"
export PATH="$PATH:$ANDROID_HOME/build-tools/36.0.0" # check build tools
export PATH="$PATH:$ANDROID_HOME/cmdline-tools/latest/bin"
@0guzhan
0guzhan / eclipse.desktop
Created December 25, 2024 22:53
eclipse launcher
#!/usr/bin/env xdg-open
[Desktop Entry]
Type=Application
Terminal=false
Encoding=UTF-8
Version=1.1
Name=Eclipse IDE for Java Developers - 2023-03
StartupWMClass=Eclipse
Exec=env GTK_IM_MODULE=ibus /home/oguzhan/eclipse/java-2023-03/eclipse/eclipse
Categories=Development;IDE;
@0guzhan
0guzhan / google_checkstyle_suppressions.xml
Created August 18, 2023 00:49
How to fully disable javadoc checking with checkstyle maven plugin?
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suppressions PUBLIC
"-//Puppy Crawl//DTD Suppressions 1.1//EN"
"http://www.puppycrawl.com/dtds/suppressions_1_1.dtd">
<suppressions>
<!-- Suppressions for Javadoc rules -->
<suppress checks="InvalidJavadocPosition" files="."/>
<suppress checks="JavadocTagContinuationIndentation" files="."/>
<suppress checks="SummaryJavadoc" files="."/>
<suppress checks="JavadocParagraph" files="."/>
@0guzhan
0guzhan / spring-el.java
Created April 14, 2020 07:07
spring expression language example
@Autowired
private Employee firstEmployee;
/*
name
#this.toString()
roles.?[level>7].![id]
roles.?[id>0].toString()
roles.![roleName]
roles.![{role_name:roleName,id:id}].toString()

void is not a type in java.

because void keyword in java tells the behaviour of java execution stack which is a completely empty stack at the end of void method execution (not returning a type). this yields a distinction between expressions and statements in java language. in contrary to java, in scala everything is expression thus always returns (or evaluates to) sth.

scala types

AnyVal: all primitive types + void (unit) AnyRef: all java ref (object) types + all scala ref types Any: AnyVal + AnyRef

@0guzhan
0guzhan / read_csv.py
Created November 19, 2018 22:20
read csv
import csv
def read_csv(path, num_lines = 10):
with open(path,"r") as f:
reader = csv.reader(f)
next(reader, None)
i = 0
for row in reader:
print(row)
i=i+1
@0guzhan
0guzhan / Test.java
Created June 13, 2018 00:27
Weighted Round Robin implementation
/*
* Copyright 2018 oguzhan acargil
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@0guzhan
0guzhan / gist:e50b7b43471ec7f82617e9f6a0f788cb
Created June 9, 2018 22:13
git init add origin set upstream pull push
git init .
git remote add origin [email protected]:0guzhan/review.git
git remote -v
git branch --set-upstream-to=origin/master master
git remote set-url origin [email protected]:0guzhan/review.git
@0guzhan
0guzhan / AuthenticateFilter.java
Created November 19, 2017 21:42
AuthenticateFilter for Dropwizard Restful Endpoint which simply checks authentication with filter HTTP Request
import org.apache.commons.lang3.StringUtils;
import com.google.inject.Singleton;
import java.io.IOException;
import java.util.List;
import java.util.Random;
import javax.ws.rs.container.ContainerRequestContext;
import javax.ws.rs.container.ContainerRequestFilter;