Skip to content

Instantly share code, notes, and snippets.

View HackinwaleDev's full-sized avatar
🏠
Open for Remote Jobs

HackinwaleDev

🏠
Open for Remote Jobs
View GitHub Profile
@HackinwaleDev
HackinwaleDev / HMAC IMPLEMENTATION FOR BITAPS API ENDPOINT
Created August 2, 2019 00:21
The implementation has been done to my best of knowledge and also research the web for standard pseudocode yet I keep getting error. Please take a look.
// import the useful packages
const crypto = require('crypto');
const sha256 = require('sha256');
// defining the variables
let nonce = crypto.randomBytes(16).toString('base64');
let key = sha256.x2(WALLET_ID + WALLET_PASSWORD); // to double hash
let msg = WALLET_ID + nonce;
let headers = { // will be properly defined soon
@HackinwaleDev
HackinwaleDev / Let's talk Moodle in PHP
Last active April 16, 2019 17:05
Some bugs here I don't know why
//Get performance trend [=>Not getting desired result yet.]
public function get_performance_trend(){
global $DB;
//Query for all enrolled course first
$sql = "select c.id as id, c.shortname,c.category from {course} c
inner join {enrol} e on e.courseid = c.id
inner join {user_enrolments} u on e.id=u.enrolid
where u.userid=15"; //total is 6
@HackinwaleDev
HackinwaleDev / readme.txt
Created November 8, 2018 16:14
Let's Talk D3js
D3js