Skip to content

Instantly share code, notes, and snippets.

😅
Again "nganu"

Cahya Dyazin dyazincahya

😅
Again "nganu"
Block or report user

Report or block dyazincahya

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@dyazincahya
dyazincahya / in_array_r.php
Last active Aug 27, 2018
PHP Function in_array multidimension
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
@dyazincahya
dyazincahya / index.html
Last active May 2, 2018
Sitemap blogger for kang-cahya.com
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-->
@dyazincahya
dyazincahya / checkPangram1.js
Created Apr 28, 2018
a simple function for check that is pangram text or not
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
@dyazincahya
dyazincahya / download_file_nativescript.js
Last active Nov 17, 2017
Code for download file on nativescript
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+"')";
@dyazincahya
dyazincahya / facebook_fanspage.html
Created Oct 27, 2017
Widget blog facebook fans page kang-cahya.com
View facebook_fanspage.html
<iframe src="https://web.facebook.com/plugins/page.php?adapt_container_width=false&app_id=113869198637480&channel=https%3A%2F%2Fstaticxx.facebook.com%2Fconnect%2Fxd_arbiter%2Fr%2FiPrOY23SGAp.js%3Fversion%3D42%23cb%3Df2d827014fcb94c%26domain%3Ddevelopers.facebook.com%26origin%3Dhttps%253A%252F%252Fdevelopers.facebook.com%252Ff34967aaf9b1bec%26relation%3Dparent.parent&container_width=613&height=330&hide_cover=false&href=https%3A%2F%2Fwww.facebook.com%2Fkangcahyadotcom%2F&locale=en_US&sdk=joey&show_facepile=false&small_header=true&tabs=messages%2C+timeline%2C+events&width=300&_rdr" width="300" height="330"></iframe>
@dyazincahya
dyazincahya / datamhs_bad.pas
Created Oct 25, 2017
[25 OKTOBER 2017] PROGRAM PASCAL PRAKTIKUM STRUKTURE DATA
View datamhs_bad.pas
{*
* PROGRAM PASCAL
* PRAKTIKUM STRUKTURE DATA
* 25 OKTOBER 2017
* - BAD VERSION -
*}
program datamhs;
uses crt;
var pil,i,k,j : integer;
@dyazincahya
dyazincahya / array2dim2.java
Created Oct 23, 2017
Kumpulan tugas JAVA bid, robi, iqbal, cahya (Semester 3)
View array2dim2.java
/**
* program array 2 dimensi
*
* @author (Cahya Dyazin)
* @version (0.1 11/10/2017)
*/
import java.util.Scanner;
public class array2dim2
@dyazincahya
dyazincahya / dataku.txt
Created Oct 10, 2017
Tugas pemrogramman 3 semester 3 [1 - 4]
View dataku.txt
96983749632949234689234932649236493289469236
97938249732432432238497320949032430432048032
23432432432214241948194708207210381300923801
92479864912741970123821038021362137092832080
92638238735497324937983209402374093280432048
93274903270483204709380380480234032083204830
92374023091730170301203018021380273074343293
23423543657878985663453524325346478756856475
@dyazincahya
dyazincahya / NilaiMahasiswa.pas
Last active Sep 26, 2017
Semua kodingan pascal :: semester 3
View NilaiMahasiswa.pas
{ Author : Cahya Dyazin }
{ Blog : www.kang-cahya.com }
{ Version : 0.1 }
program NilaiMahasiswa;
type data = record
npm : String;
nama : String;
uts : Real;
View nativescript-upload-pic-to-php.js
var enumsModule = require("ui/enums");
var cameraModule = require("camera");
var fs = require('file-system');
var bghttp = require("nativescript-background-http");
exports.takephoto = function(args) {
cameraModule.takePicture({width: 800, height: 800, keepAspectRatio: true}).then(function(picture) {
var savepath = fs.knownFolders.currentApp().path + "/saved_images";
var filename = 'img_' + new Date().getTime() + '.jpg';
var filepath = fs.path.join(savepath, filename);
You can’t perform that action at this time.