Skip to content

Instantly share code, notes, and snippets.

View tuttelikz's full-sized avatar
🔨
生き甲斐

San Askaruly tuttelikz

🔨
生き甲斐
View GitHub Profile
@tuttelikz
tuttelikz / save_text_storage.java
Created February 9, 2018 02:36
this is a function to save strings to internal storage in android
public void save(View view) {
String text1 = username.getText().toString();
String text2 = password.getText().toString();
text1 = text1 + " ";
File file = null;
FileOutputStream fileOutputStream = null;
try {
file=getFilesDir();
fileOutputStream = openFileOutput("vivz.txt", Context.MODE_PRIVATE);
@tuttelikz
tuttelikz / load_text_storage.java
Created February 9, 2018 08:11
This is a function to load text from storage
public void load(View view) {
try {
FileInputStream fileInputStream = openFileInput("vivz.txt");
int read = -1;
StringBuffer buffer = new StringBuffer();
while((read=fileInputStream.read())!=-1) {
buffer.append((char) read);
}
Log.d("VIVZ",buffer.toString());
String text1 = buffer.substring(0,buffer.indexOf(" "));
@tuttelikz
tuttelikz / demo.cpp
Created February 21, 2018 01:58
Clova Task
This is a demo task.
Write a function:
int solution(vector<int> &A);
that, given an array A of N integers, returns the smallest positive integer (greater than 0) that does not occur in A.
For example, given A = [1, 3, 6, 4, 1, 2], the function should return 5.
@tuttelikz
tuttelikz / copy_folders_no_contents.sh
Created February 23, 2018 05:32
Windows command to copy folders without contents
xcopy C:\Folders D:\Folders /t /e
@tuttelikz
tuttelikz / exit_vim_terminal.sh
Created February 27, 2018 01:51
Bash to exit vim in terminal
:q!
@tuttelikz
tuttelikz / increase_gradle_build_speed
Created February 28, 2018 01:41
Found an easy and best way to build gradle go to your app >> open your gradle.properties and change few lines from it [remove #] else you may copy paste my below snippet as well
# Project-wide Gradle settings.
# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.
# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html
# Specifies the JVM arguments used for the daemon process.
@tuttelikz
tuttelikz / read_save_filenames_directory.sh
Created March 5, 2018 03:19
A simple bash command to read the filenames from directory and save it to text file
ls > filenames.txt
@tuttelikz
tuttelikz / instructs_ext_library_jar
Created March 6, 2018 00:57
Adding library to Android Project
How to add jar file:
https://stackoverflow.com/questions/16608135/android-studio-add-jar-as-library
How to find libs folder:
https://stackoverflow.com/questions/26956827/have-no-libs-directory-in-android-studio
@tuttelikz
tuttelikz / NetworkOnMainThreadException
Last active March 6, 2018 04:00
How to fix NetworkOnMainThreadException when uploading to ftp
android.os.NetworkOnMainThreadException?
You should almost always run network operations on a thread or as an asynchronous task.
https://stackoverflow.com/a/9289190/5151687
com.jcraft.jsch.JSchException: UnknownHostKey:
session.setConfig("StrictHostKeyChecking", "no");
Working ftp:
https://stackoverflow.com/questions/2003419/com-jcraft-jsch-jschexception-unknownhostkey
@tuttelikz
tuttelikz / android_adb_shell
Created March 6, 2018 04:49
Command to access files with ADB Shell of Android
adb -d shell