Skip to content

Instantly share code, notes, and snippets.

@pask23
pask23 / README.md
Created December 1, 2023 00:52
androidcheckertools

Nel caso in cui venga fornita una cartella come argomento, lo script itera su tutti i file APK all'interno della cartella. Se vengono forniti singoli file APK come argomenti, verranno trattati uno per uno.

Puoi eseguire lo script in questo modo:

./check_version_code.sh path/to/your/apps

oppure

./check_version_code.sh path/to/your/app1.apk path/to/your/app2.apk

@pask23
pask23 / BooksRemoteDataSourceImpl.kt
Last active March 21, 2022 14:24
Example Clean Architecture
//Data Layer
// data/repositories/book
class BooksRemoteDataSourceImpl(
private val service: BooksApi,
private val mapper: BookApiResponseMapper
) : BooksRemoteDataSource {
override suspend fun getBooks(author: String): Result<List<Volume>> =
withContext(Dispatchers.IO) {
try {
val response = service.getBooks(author)
@pask23
pask23 / MainActivity.kt
Created March 12, 2020 12:17 — forked from sankarcheppali/MainActivity.kt
Connecting WiFi programmatically
package example.siva.com.hellokotlin
import android.content.BroadcastReceiver
import android.content.Context
import android.support.v7.app.AppCompatActivity
import android.os.Bundle
import android.util.Log
import kotlinx.android.synthetic.main.activity_main.*
import org.jetbrains.anko.toast
import android.net.wifi.WifiConfiguration
@pask23
pask23 / docker-compose.yaml
Created April 4, 2019 16:58 — forked from indiejoseph/docker-compose.yaml
Docker compose for Home Assistant
version: "3"
services:
homeassistant:
container_name: homeassistant
image: homeassistant/home-assistant:latest
restart: unless-stopped
volumes:
- ./homeassistant/config:/config
- /etc/localtime:/etc/localtime:ro
ports:
@pask23
pask23 / PhonecallReceiver.java
Created December 5, 2018 20:48 — forked from ftvs/PhonecallReceiver.java
Detecting an incoming call coming to an Android device. Remember to set the appropriate permissions in AndroidManifest.xml as suggested in the Stackoverflow link. Usage example in comments. Source: http://stackoverflow.com/a/15564021/264619 Explanation: http://gabesechansoftware.com/is-the-phone-ringing/#more-8
package com.gabesechan.android.reusable.receivers;
import java.util.Date;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.telephony.TelephonyManager;
public abstract class PhonecallReceiver extends BroadcastReceiver {
@pask23
pask23 / node-and-npm-in-30-seconds.sh
Created December 3, 2018 13:45 — forked from isaacs/node-and-npm-in-30-seconds.sh
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at http://joyeur.com/2010/12/10/installing-node-and-npm/ Note: npm >=0.3 is *safer* when using sudo.
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh
@pask23
pask23 / basic-card.json
Created November 16, 2018 12:56 — forked from manniru/basic-card.json
Actions on Google Conversation API v2 - Sample Responses
{
"items": [
{
"simpleResponse": {
"textToSpeech":"This is the first simple response for a basic card"
}
},
{
"basicCard": {
"title":"Title: this is a title",
@pask23
pask23 / gist:d00358585f294053c5827ad3c8ec1b2f
Created August 31, 2018 16:09 — forked from paulallies/gist:0052fab554b14bbfa3ef
Remove node_modules from git repo
#add 'node_modules' to .gitignore file
git rm -r --cached node_modules
git commit -m 'Remove the now ignored directory node_modules'
git push origin master
@pask23
pask23 / app_bar.xml
Created May 5, 2018 01:04
drawer layout
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.AppBarLayout
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/AppTheme.AppBarOverlay"
android:id="@+id/appbar">
<android.support.v7.widget.Toolbar
@pask23
pask23 / AcademicQualificationAdapter
Created March 29, 2018 11:04
Android UI bullets
package com.tutored.tutored.ui.userprofile.academicsQualification;
import android.view.View;
import com.pask.data.model.AcademicQualification;
import com.pask.data.model.dto.MessageEventDTO;
import com.pask.ui.userprofile.ExperienceFragment;
import com.pask.ui.userprofile.ExperienceRecyclerViewAdapter;
import com.pask.utils.TextUtils;