Skip to content

Instantly share code, notes, and snippets.

View rizdaprasetya's full-sized avatar

Rizda Dwi Prasetya rizdaprasetya

View GitHub Profile
@rizdaprasetya
rizdaprasetya / BaseModel.cs
Created December 20, 2016 08:37 — forked from SimianLogic/BaseModel.cs
Use Google Spreadsheets as a CMS for Your Unity Game
using UnityEngine;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Reflection;
public abstract class BaseModel<T> where T : BaseModel<T>
{
private static bool SHOW_DEBUGGING_MESSAGES = false;
}else if ($veritrans_notification->transaction_status == 'expire'){
try{
$history->changeIdOrderState(Configuration::get('VT_PAYMENT_FAILURE_STATUS_MAP'), $order_id_notif);
} catch (Exception $e) {
echo "not updated";
}
echo 'Expire notification accepted.';
}
@rizdaprasetya
rizdaprasetya / ImdbMovieParser.js
Created October 6, 2018 03:20
IMDB movie to JSON
/* Go to movie page in IMDB using browser.
Paste this code to Browser JS console to turn movie page to JSON of the movie
JSON compatible with: https://github.com/jsonmc/jsonmc */
var ImdbMovieParser = (function(){
var parsePageForMovie = function(){
var nameAndYear = document.querySelector("[class='title_wrapper']").children[0].innerText.split('(');
var name = nameAndYear[0].trim();
var year = nameAndYear[1].split(')')[0];
year = parseInt(year);
var runtime = document.querySelectorAll('time')[1].innerText.match(/\d+/g)[0];
@rizdaprasetya
rizdaprasetya / cheat_sheet.md
Last active April 11, 2019 10:59
Alpine Linux Docker Image Useful Commands
  • Quickly install Git: apk update && apk upgrade && apk add git
  • Quickly install Git and clone repo apk update && apk upgrade && apk add git && git clone <URL>

Quickly get any language env based on docker

@rizdaprasetya
rizdaprasetya / index.html
Last active June 26, 2019 07:51
Midtrans Register Card API via JSONP frontend Sample
<!DOCTYPE html>
<html>
<head>
<title>Sandbox</title>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/prism/1.15.0/themes/prism.css" />
</head>
<body>
@rizdaprasetya
rizdaprasetya / docsify-pagination@2.5.0.mod.js
Created March 3, 2020 06:21
Docsify Pagination Plugin Fix for `routerMode:history`
// @MODIFIED from https://cdn.jsdelivr.net/npm/docsify-pagination@2.5.0/dist/docsify-pagination.js
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory() :
typeof define === 'function' && define.amd ? define(factory) :
(factory());
}(this, (function () { 'use strict';
function createCommonjsModule(fn, module) {
return module = { exports: {} }, fn(module, module.exports), module.exports;
}
@rizdaprasetya
rizdaprasetya / charge-request.sh
Created July 21, 2021 09:48
Integrate POS Device with GoPay an QRIS - request
curl https://api.midtrans.com/v2/charge \
--request POST \
--user 'YOUR_SERVER_KEY:' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'X-Override-Notification: YOUR_BACKEND_URL_TO_RECEIVE_NOTIFICATION' \
--data '{
"payment_type": "qris",
"transaction_details": {
"order_id": "order102",
@rizdaprasetya
rizdaprasetya / notification.json
Last active July 21, 2021 09:53
Integrate POS Device with GoPay an QRIS - notification
{
"transaction_type": "on-us",
"transaction_time": "2021-06-23 15:45:42",
"transaction_status": "settlement",
"transaction_id": "01bf5e23-7183-4cfe-862c-58a3f6e8f0a2",
"status_message": "midtrans payment notification",
"status_code": "200",
"signature_key": "5d40504728eb96686bd5926299768a6496547f70dbd1e19d583ef4e780fe9dd5c38d0db45ec0f06dafa5c56caa6cf8358ead1523882b5fb3e102c52345d41850",
"settlement_time": "2021-06-23 15:46:00",
"payment_type": "qris",
@rizdaprasetya
rizdaprasetya / response.json
Created July 21, 2021 09:55
Integrate POS Device with GoPay an QRIS - response
{
"status_code": "201",
"status_message": "QRIS transaction is created",
"transaction_id": "01bf5e23-7183-4cfe-862c-58a3f6e8f0a2",
"order_id": "order102",
"merchant_id": "G490526303",
"gross_amount": "789000.00",
"currency": "IDR",
"payment_type": "qris",
"transaction_time": "2021-07-06 17:23:49",
; 20191020_070434
[general]
;server_check_url=http://www.google.com/generate_204
;geo_location_checker=http://www.example.com/json/, https://www.example.com/script.js
;dns_exclusion_list=*.qq.com, qq.com, *.cmpassport.com
;ssid_suspended_list=LINK_22E174, LINK_22E175
;udp_whitelist=53, 123, 1900, 80-443
;excluded_routes= 192.168.0.0/16, 172.16.0.0/12, 100.64.0.0/10, 10.0.0.0/8
;icmp_auto_reply=true