This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
implementation "androidx.work:work-runtime:2.2.0" | |
implementation "com.squareup.okhttp3:okhttp:4.2.2" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package xyz.ariefbayu.android.workmanagertutorial.worker; | |
import android.content.Context; | |
import android.util.Log; | |
import androidx.annotation.NonNull; | |
import androidx.work.ExistingWorkPolicy; | |
import androidx.work.OneTimeWorkRequest; | |
import androidx.work.PeriodicWorkRequest; | |
import androidx.work.WorkManager; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
OneTimeWorkRequest refreshWork = new OneTimeWorkRequest.Builder(ProcessingWorker.class).build(); | |
WorkManager.getInstance(getApplicationContext()).enqueueUniqueWork(PUSH_LOCATION_WORK_TAG, ExistingWorkPolicy.KEEP, refreshWork); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
OneTimeWorkRequest refreshWork = new OneTimeWorkRequest.Builder(ProcessingWorker.class).build(); | |
WorkManager.getInstance(getApplicationContext()).enqueueUniqueWork(PUSH_LOCATION_WORK_TAG, ExistingWorkPolicy.KEEP, refreshWork); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class JsonLoadAndCacher { | |
public $url; | |
public $hash; | |
//set cache directory here | |
private $fileLocation = 'd:/temp/'; | |
public function LoadJson($url) { | |
$hash = md5($url); | |
//set your cached offline file as variable for ease of use |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if(project.hasProperty("serverbuild.properties") | |
&& new File(project.property("serverbuild.properties")).exists()) { | |
Properties props = new Properties() | |
props.load(new FileInputStream(file(project.property("serverbuild.properties")))) | |
android { | |
signingConfigs { | |
release { | |
storeFile file(props['keystore']) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
buildscript { | |
repositories { | |
maven { url 'https://maven.fabric.io/public' } | |
} | |
dependencies { | |
classpath 'io.fabric.tools:gradle:1.+' | |
} | |
} | |
apply plugin: 'com.android.application' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$loader = require __DIR__.'/vendor/autoload.php'; | |
use Longman\TelegramBot\Request; | |
$API_KEY = '--botfather-api-keu--'; | |
$BOT_NAME = '--bofather-bot-name--'; | |
$telegram = new Longman\TelegramBot\Telegram($API_KEY, $BOT_NAME); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File file1 = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS) + "/Master/CAM_" + s.getType() + "_" + s.getJobCode() + ".jpg"); | |
File file2 = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS) + "/Master/SIGN_" + s.getType() + "_" + s.getJobCode() + ".jpg"); | |
Log.d("LOG", "File1: "+ (file1.exists() ? "E" : "N") + " -> " + file1.getAbsolutePath()); | |
Log.d("LOG", "File2: "+ (file2.exists() ? "E" : "N") + " -> " + file2.getAbsolutePath()); | |
RequestBody requestBody = new MultipartBuilder() | |
.type(MultipartBuilder.FORM) | |
.addFormDataPart("gambar1", file1.getName(), | |
RequestBody.create(MEDIA_TYPE_IMAGE, file1)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(for FILE in *.flac ; do ffmpeg -i "$FILE" -f mp3 -ab 320000 -map_metadata 0 -id3v2_version 3 "`basename "$FILE" .flac`.mp3" || break; done) |
NewerOlder