Instantly share code, notes, and snippets.

View error kotlin
org.gradle.initialization.ReportedException: org.gradle.internal.exceptions.LocationAwareException: Execution failed for task ':app:compileDebugKotlin'.
at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:145)
at org.gradle.initialization.DefaultGradleLauncher.executeTasks(DefaultGradleLauncher.java:115)
at org.gradle.internal.invocation.GradleBuildController$1.call(GradleBuildController.java:78)
at org.gradle.internal.invocation.GradleBuildController$1.call(GradleBuildController.java:75)
at org.gradle.internal.work.DefaultWorkerLeaseService.withLocks(DefaultWorkerLeaseService.java:152)
at org.gradle.internal.invocation.GradleBuildController.doBuild(GradleBuildController.java:100)
at org.gradle.internal.invocation.GradleBuildController.run(GradleBuildController.java:75)
at org.gradle.tooling.internal.provider.runner.ClientProvidedBuildActionRunner.run(ClientProvidedBuildActionRunner.java:62)
at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuil
View install_phpexcel_lampp.sh
#!/bin/bash
# @author : kang cahya
# @github : https://github.com/dyazincahya
# ##########################################
# ###################################################################################################
# requirements:
# - REDHAT 6.x
# - sudo access
#
View install_phpexcel_php72.sh
#!/bin/bash
#
# Example script to install LibXL, ilia/php_excel on PHP 7.2 (ondrej/ppa)
#
# Usage:
# > sudo ./install_phpexcel_php72.sh
# > sudo service php7.2-fpm reload (if using fpm)
#
# Requirements:
# - Tested with Ubuntu 64bits (14.04, 16.04+)
View install_phpexcel_php7.sh
#!/bin/bash
#
# ilia/php_excel extension example install script for PHP7+
#
# usage:
# > sudo ./install_phpexcel_php7.sh
# > (optionally) sudo service php7.1-fpm restart)
#
# requirements:
# - Ubuntu 64bits (trusty/xenial)
View strarr_to_arr.php
<?php
// function
function strarr_to_array($a, $t = ''){
$arr = [];
$a = ltrim($a, '[');
$a = ltrim($a, 'array(');
$a = rtrim($a, ']');
$a = rtrim($a, ')');
$tmpArr = explode(",", $a);
foreach ($tmpArr as $v) {
View downloadFile.js
const fs = require('file-system');
const httpModule = require("http");
exports.download = function (args) {
let data = args.object;
context.set("xLoading", { "status": true, "text": "Downloading..." });
var androidDownloadsPath = android.os.Environment.getExternalStoragePublicDirectory(android.os.Environment.DIRECTORY_DOWNLOADS).toString();
let url = data.get("url");
View in_array_r.php
<?php
function in_array_r($thekey, $arraydata, $strict = false)
{
foreach ($arraydata as $item)
{
if (($strict ? $item === $thekey : $item == $thekey) || (is_array($item) && in_array_r($thekey, $item, $strict)['found']))
{
return array(
"found" => true,
"data" => $item
View index.html
<div id="toc">
<script src="https://cdn.rawgit.com/dyazincahya/9ecfa81d87af2bc2e36a6e9566fb67bf/raw/52def2eea6302cf8a43f51ce268bfd78e6ae41e0/k4ng_sitemap.js" type="text/javascript"></script>
<script src="https://www.kang-cahya.com/feeds/posts/default?max-results=9999&amp;alt=json-in-script&amp;callback=loadtoc"></script>
</div>
<!-- OLD -->
<!--div id="bp_toc">
</div>
<script src="https://cdn.rawgit.com/Arlina-Design/redvision/master/sitemap-content.js" type="text/javascript"></script> <script src="/feeds/posts/summary?alt=json-in-script&amp;max-results=9999&amp;callback=loadtoc" type="text/javascript"></script-->
View checkPangram1.js
function isPangram(sentence)
{
const setSentence = new Set(sentence.toLowerCase().replace(/[^a-z]/g,""));
return setSentence.size === 26;
}
const pangram = "The quick brown fox jumps over the crazy little dog";
alert(isPangram(pangram)); //true
View download_file_nativescript.js
var androidDownloadsPath = android.os.Environment.getExternalStoragePublicDirectory(
android.os.Environment.DIRECTORY_DOWNLOADS).toString();
// console.log("pathnya : "+androidDownloadsPath);
// creates PATH for folder called MyFolder in /Downloads (string value)
var myFolderPath = fileSystem.path.join(androidDownloadsPath, dtb.tf_filename);
var urldownload=config.apiUrl+"project/download/"+dtb.tf_filename;
// console.log(urldownload);
// myFolderPath=urldownload;
var sqlfile="insert into trx_file (tf_id,tf_rp_id,tf_parent_id,tf_child_id,tf_create_date,tf_su_id,tf_su_username,tf_type,tf_filename,tf_sync,tf_note,tf_lon,tf_lat,tf_filepath,tf_pending) values ('"+dtb.tf_id+"','"+dtb.tf_rp_id+"','"+dtb.tf_parent_id+"','"+dtb.tf_child_id+"','"+dtb.tf_create_date+"','"+dtb.tf_su_id+"','"+dtb.tf_su_username+"','"+dtb.tf_type+"','"+dtb.tf_filename+"','1','"+dtb.tf_note+"','"+dtb.tf_lon+"','"+dtb.tf_lat+"','"+myFolderPath+"','"+dtb.tf_pending+"')";