Skip to content

Instantly share code, notes, and snippets.

View engincancan's full-sized avatar
🙂
I may be slow to respond.

Engin CAN engincancan

🙂
I may be slow to respond.
View GitHub Profile
//src: http://kurrytran.blogspot.ru/2014/05/android-studio-list-of-suppress-warning.html
//https://android.googlesource.com/platform/tools/adt/idea/+/jb-mr2-dev/adt-branding/src/META-INF/AndroidIdePlugin.xml
//https://android.googlesource.com/platform/tools/adt/idea/+/jb-mr2-dev/android/src/META-INF/plugin.xml
//Most Common Annotations
@SuppressWarnings("all")
@SuppressWarnings("unchecked")
@SuppressWarnings({"JavaDoc"})
@SuppressWarnings({"UnusedDeclaration"})
@engincancan
engincancan / macosx_remove_java9.sh
Created November 27, 2017 13:50 — forked from schnell18/macosx_remove_java9.sh
MacOS X remove Java 9
sudo rm -fr /Library/Java/JavaVirtualMachines/jdk-9.jdk/
sudo rm -fr /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin
sudo rm -fr /Library/PreferencePanes/JavaControlPanel.prefPane
@engincancan
engincancan / deployApks.groovy
Created April 24, 2017 06:27 — forked from aquaflamingo/deployApks.groovy
Gradle task to archive APKs once built through android studio by running ./gradlew deployApks
task deployApks(type:Copy) {
description = "Copies APKs and Proguard mappings to the deploy directory"
def appName = "posture";
def versionDir = android.defaultConfig.versionName+"_"+android.defaultConfig.versionCode;
println("Copies APK and Proguard to " + versionDir)
from 'build/outputs/mapping/release/'
include '**/mapping.txt'
into '../.admin/deploy/' + versionDir
@engincancan
engincancan / Test.log
Created April 21, 2017 07:01
Test Against Startswith, Regex, Contains
System.out: startsWith took: 16
System.out: matches took: 25
System.out: contains took: 2
System.out: startsWith took: 15
System.out: matches took: 32
System.out: contains took: 5
System.out: startsWith took: 11
System.out: matches took: 40
System.out: contains took: 6
System.out: startsWith took: 14
python 2to3.py --output-dir="C:\outputpy3" -W -n "C:\py2.py"
# in directory: project
git rm --cached --force .idea/compiler.xml
git rm --cached --force .idea/gradle.xml
@engincancan
engincancan / openface-data-example
Created March 20, 2017 10:30 — forked from bamos/openface-data-example
OpenFace Data Example
$ tree data/mydataset/raw
person-1
├── image-1.jpg
├── image-2.png
...
└── image-p.png
...
person-m
@engincancan
engincancan / lang.gradle
Created March 20, 2017 08:29
List Of Supported Languages for Gradle (Android)
task buildTranslationArray << {
def foundLocales = new StringBuilder()
foundLocales.append("new String[]{")
fileTree(dir: 'src', includes: [ '**/*.xml'], exclude: '**/*test*/**').visit { FileVisitDetails details ->
def path = details.file.path;
if (path.endsWith("strings.xml")) {
def languageCode = path.substring(path.indexOf("values"), path.length()).replaceAll('values-','').replace("\\strings.xml", "")
// def languageCode = details.file.parent.tokenize('/').last().replaceAll('values-','').replaceAll('-r','-')
public void onCreate() {
if (DEVELOPER_MODE) {
StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder()
.detectDiskReads()
.detectDiskWrites()
.detectNetwork() // or .detectAll() for all detectable problems
.penaltyLog()
.build());
StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder()
.detectLeakedSqlLiteObjects()
//Type.java
public enum Type { A, B, C, D, E, F, G, H, I, J };
// Base.java
public abstract class Base {
int i = 1;
final Type type;
public Base(Type type) {