Skip to content

Instantly share code, notes, and snippets.

@thebatu
thebatu / proj2txt.rb
Last active July 9, 2023 00:10
Ruby script to read an Android project and transform it into a single txt file to feed it to chatGPT
require 'find'
def read_directory(dir_path, output_file_path)
File.open(output_file_path, 'w') do |output_file|
Find.find(dir_path) do |path|
if FileTest.directory?(path)
if File.basename(path) == 'build'
Find.prune # Don't look any further into this directory.
else
next
@thebatu
thebatu / KeyboardUtils.java
Last active November 28, 2022 23:08
Close Soft Keyboard on Android.
import android.content.Context;
import android.view.View;
import android.view.inputmethod.InputMethodManager;
import androidx.appcompat.app.AppCompatActivity;
import androidx.fragment.app.Fragment;
public class KeyboardUtils
{
public static void closeSoftKeyboard(View view)
{