Skip to content

Instantly share code, notes, and snippets.

View Thisura98's full-sized avatar

Thisura Dodangoda Thisura98

  • Colombo, Sri Lanka
  • 16:36 (UTC +05:30)
View GitHub Profile
@Thisura98
Thisura98 / myslt.dailyusage.js
Created October 8, 2023 15:50
Finds the total GB used for a month in the MySLT Portals' Broadband > Daily Usage tab
/**
* INSTRUCTIONS:
*
* Make sure you are on the Broadband > Daily Usage tab of the MySLT Portal
*
* Right click any where on the web page and click "Inspect".
* The Inspect window will open, go to the "Console" tab.
*
* Select the month you want to the total for in the MySLT Daily Usage tab
* Copy & paste in the following code in the Console tab of the Inspector window.
<?php
/**
* @package CRM
* @copyright CiviCRM LLC https://civicrm.org/licensing
*
* Generated from xml/schema/CRM/Core/Extension.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
* (GenCodeChecksum:8d9c173c0d7da38d4c28c6b712aecee0)
*/
@Thisura98
Thisura98 / ph_wc_replace_logo.php
Created November 24, 2020 10:29
Change the PayHere Logo in the PayHere WooCommerce Plugin
<?php
add_filter( 'woocommerce_gateway_icon', 'modify_payhere_ico', 10, 2 );
function modify_payhere_ico($ico_html, $payment_gateway_id){
if ( $payment_gateway_id != 'payhere' ){
return $ico_html;
}
$current_image_url = '/(.+)(https:\/\/www.payhere.lk\/downloads\/images\/payhere_long_banner.png)(.+)/';
$new_image_url = 'https://bit.ly/3pijjpk'; // replace this
@Thisura98
Thisura98 / ASP.NET Core MD5 Method.cs
Created June 9, 2020 18:03
Describes a method to generate MD5 hashes in C#
using System.Security.Cryptography;
public class PaymentPayHereController : BasePaymentController{
/**
MD5 Hashes the input string.
Return value contains only lowercase alphabeticals and numbers.
*/
private string GenerateHash(string input)
{
MD5 provider = new MD5CryptoServiceProvider();
@Thisura98
Thisura98 / PHBottomViewController2.swift
Last active March 21, 2020 03:28
Comparison with the Old and New PHBottomViewControllers
//
// PHBottomViewController.swift
// payHereSDK
//
// Created by Kamal Upasena on 12/17/19.
// Copyright © 2019 PayHere. All rights reserved.
//
import UIKit
import Alamofire
@Thisura98
Thisura98 / PHBottomViewController.swift
Created March 18, 2020 10:46
Modified to support Sandbox in a very easy set of steps
//
// PHBottomViewController.swift
// payHereSDK
//
// Created by Kamal Upasena on 12/17/19.
// Copyright © 2019 PayHere. All rights reserved.
//
import UIKit
import Alamofire
@Thisura98
Thisura98 / DynamicFormsTest.swift
Created March 16, 2020 11:27
Creating completely dynamic forms
/**
Fixed identifiers for the Fields
*/
enum FieldID{
case unknown
case country
case registration
case condition
case quantity
case year