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 / php-js-aes
Last active September 23, 2019 00:36
AES encrypt-decrypt between php and javascript
//JAVASCRIPT
import CryptoJS from 'crypto-js';
import { Base64 } from 'js-base64';
const key = 'DK7Mf0GD1JR1Z3ROxeh+l/crGYKHVglLsInUN8Q8RiY=';
//function "unserialize" IS COPY FROM http://locutus.io/php/unserialize/
const unserialize = data => {
var $global = typeof window !== 'undefined' ? window : global;
var utf8Overhead = function(str) {
var s = str.length;
@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"
},
{
// 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 / 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;
@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 / 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 / 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 / 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 / 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",
function copy_var(data){
return JSON.parse(JSON.stringify(data));
}