Skip to content

Instantly share code, notes, and snippets.

View 0guzhan's full-sized avatar

Oguzhan Acargil 0guzhan

  • Amsterdam
  • 04:28 (UTC +02:00)
View GitHub Profile
@0guzhan
0guzhan / android-studio.desktop
Created August 30, 2015 18:08
Android studio desktop shortcut for linux. I am using on my Debian Jessie
#!/usr/bin/env xdg-open
[Desktop Entry]
Version=1.0
Type=Application
Name=Android Studio
Exec="/opt/android-studio/bin/studio.sh" %f
Icon=/opt/android-studio/bin/studio.png
Categories=Development;IDE;
Terminal=false
StartupNotify=true
@0guzhan
0guzhan / android_sdk_debian64_problem.sh
Created August 30, 2015 19:45
Android SDK Debian Jessie 64bit "timed out while wating for slave aapt process" problem
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install libncurses5:i386 libstdc++6:i386 zlib1g:i386
@0guzhan
0guzhan / eclipse_formatter.xml
Last active September 15, 2015 07:09
Eclipse java code formatter
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<profiles version="12">
<profile kind="CodeFormatterProfile" name="Oguzhan" version="12">
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_ellipsis" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters" value="insert"/>
@0guzhan
0guzhan / gradle.properties
Created October 7, 2015 06:38
gradle http/https proxy settings
systemProp.http.proxyHost=proxyhost
systemProp.http.proxyPort=80
systemProp.http.proxyUser=username
systemProp.http.proxyPassword=password
systemProp.http.nonProxyHosts=localhost
systemProp.https.proxyHost=proxyhost
systemProp.https.proxyPort=80
systemProp.https.proxyUser=username
systemProp.https.proxyPassword=password
@0guzhan
0guzhan / maven_install_file.bat
Created October 22, 2015 08:11
Maven install-file
mvn install:install-file \
-Dfile=apns-1.0.0.Beta7-SNAPSHOT.jar \
-DgroupId=com.notnoop.apns \
-DartifactId=apns \
-Dversion=1.0.0.Beta7_2-SNAPSHOT \
-Dpackaging=jar
@0guzhan
0guzhan / git_tips.txt
Last active July 3, 2020 11:34
Undo git push and git commit
# undo last push
git push -f origin ab123c4:master
# undo last commit
git reset --hard HEAD~2
# undo last push (7cdab32)
git push origin +7cdab32^:master
# show last commit changed files
@0guzhan
0guzhan / eclipse.ini
Created March 9, 2016 18:02
eclipse with different jdk and xmx 4096m
-startup
plugins/org.eclipse.equinox.launcher_1.3.100.v20150511-1540.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.300.v20150602-1417
-product
org.eclipse.epp.package.jee.product
--launcher.defaultAction
openFile
--launcher.XXMaxPermSize
256M
@0guzhan
0guzhan / android_resource_remover.bat
Created April 7, 2016 10:17
Removing Android Unused Resources(drawables, layouts and even string definitinions in strings.xml)
# install python 2.7.+ and install android-resource-remover module with following command
pip install android-resource-remover
# investigate project with lint that delivers with android-sdk
gradlew.bat :app:lint
# this python module will remove unused resources from android project
android-resource-remover --xml app\build\outputs\lint-results.xml
@0guzhan
0guzhan / Base64Test.java
Created May 1, 2016 13:42
Base64 endcode/decode with java.util.Base64 class
public class Base64Test {
public static void main(String[] args) {
Decoder decoder = Base64.getDecoder();
Encoder encoder = Base64.getEncoder();
byte[] raw = "any text".getBytes();
byte[] encoded = encoder.encode(raw);
System.out.println(new String(encoded));
@0guzhan
0guzhan / DnsRegexDemo.java
Created July 28, 2016 08:09
Java Regular Expression to Validate DNS Name
/**
* @author oguzhan
*
*/
public class DnsRegexDemo {
/**
* @param args
*/
public static void main(String[] args) {