Skip to content

Instantly share code, notes, and snippets.

View autotrof's full-sized avatar
๐Ÿ 
WFH

Agung Kurniawan autotrof

๐Ÿ 
WFH
View GitHub Profile
@autotrof
autotrof / convert php multidimensional array to "POSTABLE" php array with php curl
Last active March 1, 2022 10:00
get from Arr::dot in laravel. just little modification
function form_array($array, $prepend='')
{
$results = [];
foreach ($array as $key => $value) {
if (is_array($value) && ! empty($value)) {
if($prepend==''){
$results = array_merge($results, form_array($value, $key));
}else{
$results = array_merge($results, form_array($value, $prepend.'['.$key.']'));
}
function copy_var(data){
return JSON.parse(JSON.stringify(data));
}
@autotrof
autotrof / helpers.php
Created January 14, 2021 14:53
Helpers laravel untuk meringankan beban koding kalian
<?php
// 1
if (! function_exists('number_to_day')) {
function number_to_day($nomor_hari)
{
$hari = [
"",
"Ahad",
"Senin",
@autotrof
autotrof / OCI8_PECL_PHP_FPM_instructions.md
Created November 4, 2020 03:49 — forked from piotrekkr/OCI8_PECL_PHP_FPM_instructions.md
Installing OCI8 from PECL with multiple PHP FPM versions from Ondrej Sury repo in Ubuntu 16.04

Download instant client 12.2 basic and basic devel rpm from oracle

Convert rpm to deb using alien command

alien -kv oracle-instantclient12*.rpm

Install deb files

@autotrof
autotrof / inisialisasi datatable di js
Created June 24, 2020 07:43
datatable ajax dengan laravel. untuk keterangan lebih lanjut silahkan akses https://youtu.be/T-7PCbV-e8A
const table = $('#table').DataTable({
"pageLength": 100,
"lengthMenu": [[10, 25, 50, 100], [10, 25, 50, 100]],
"bLengthChange": true,
"bFilter": true,
"bInfo": true,
"processing":true,
"bServerSide": true,
ajax:{
url: "{{u()}}/dashboard/template/data",
@autotrof
autotrof / function data di controller
Last active June 24, 2020 07:41
datatable ajax laravel. function data. untuk link video bisa buka https://youtu.be/T-7PCbV-e8A
public function data(Request $request)
{
$orderBy = 'template_baru.id';
switch($request->input('order.0.column')){
case "0":
$orderBy = 'template_baru.id';
break;
case "1":
$orderBy = 'template_baru.judul';
break;
@autotrof
autotrof / nextcloud.conf
Created November 21, 2019 05:45 — forked from xxblx/nextcloud.conf
nextcloud nginx config
upstream php-handler {
server unix:/run/php-fpm/www.sock;
}
server {
#listen 443 ssl;
listen 80;
server_name 192.168.1.8;
#ssl_certificate /etc/ssl/nginx/cloud.example.com.crt;
@autotrof
autotrof / App.tsx
Last active February 3, 2024 20:33
encrypt decrypt file in react native [working with large file]. using react-native-fs and node-forge
import React from 'react';
import { StyleSheet, Text, View, PermissionsAndroid, ProgressBarAndroid } from 'react-native';
import RNFS from 'react-native-fs'
import forge from 'node-forge'
import {Buffer} from 'buffer'
import zlib from 'react-zlib-js'
const key = forge.random.getBytesSync(16);
const iv = forge.random.getBytesSync(16);
const limit_big = 1024*512;
// App.js root project
using rn-fetch-blob,node-forge, and buffer
import React from 'react';
import { StyleSheet, Text, View, PermissionsAndroid } from 'react-native';
import RNFS from 'react-native-fs';
import RNFetchBlob from 'rn-fetch-blob'
import forge from 'node-forge';
import {Buffer} from 'buffer';
@autotrof
autotrof / doa-sehari-hari
Last active January 8, 2024 17:58
Data Doa Sehari Hari Dengan Format json dari buku "Kumpulan Do'a Dari Al-Qur'an dan Hadist" karya Syekh Saad Bin Wahf Al Qahthani
[
{
tag:['rumah','kamar','setiap hari'],
judul:"Do'a Bangun Tidur (1)",
arab:"ุงู„ู’ุญูŽู…ู’ุฏู ู„ูู„ู‘ูฐู‡ู ุงู„ู‘ุฐููŠ ุฃูŽุญู’ูŠูŽุงู†ูŽุง ุจูŽุนู’ุฏูŽ ู…ูŽุง ุฃูŽู…ูŽุงุชูŽู†ูŽุง ูˆูŽุฅูู„ูŽูŠู’ู‡ู ุงู„ู†ู‘ูุดููˆู’ุฑู",
latin:"Alhamdulillahilladzi ahyaana ba'da maa amaatanaa wa ilaihinnusyuur",
arti:"Segala puji bagi Allah Yang membangunkan kami setelah ditidurkan-Nya dan kepada-Nya kami dibangkitkan",
footnote:"HR. Bukhari dalam Fathul Bari: 11/113 dan Muslim: 4/2083"
},
{