Skip to content

Instantly share code, notes, and snippets.

View voidnerd's full-sized avatar
:octocat:
Debugging

Ndifreke Friday voidnerd

:octocat:
Debugging
View GitHub Profile
##
# You should look at the following URL's in order to grasp a solid understanding
# of Nginx configuration files in order to fully unleash the power of Nginx.
# https://www.nginx.com/resources/wiki/start/
# https://www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/
# https://wiki.debian.org/Nginx/DirectoryStructure
#
# In most cases, administrators will remove this file from sites-enabled/ and
# leave it as reference inside of sites-available where it will continue to be
# updated by the nginx packaging team.
##
# You should look at the following URL's in order to grasp a solid understanding
# of Nginx configuration files in order to fully unleash the power of Nginx.
# https://www.nginx.com/resources/wiki/start/
# https://www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/
# https://wiki.debian.org/Nginx/DirectoryStructure
#
# In most cases, administrators will remove this file from sites-enabled/ and
# leave it as reference inside of sites-available where it will continue to be
# updated by the nginx packaging team.
<!doctype html>
<html>
<head>
<meta name="viewport" content="width=device-width">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script src="https://kit.fontawesome.com/e4a7d3234e.js" crossorigin="anonymous"></script>
<title>Kiitec Email Template</title>
<style>
@media only screen and (max-width: 620px) {
table[class=body] h1 {
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<script src="https://js.paystack.co/v1/inline.js"></script>
</head>
<?php
function verify($reference) {
$result = array();
//The parameter after verify/ is the transaction reference to be verified
//you have to get reference from callback url if you are using paystack standard
$url = 'https://api.paystack.co/transaction/verify/'. $reference;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
create database if not exists `worktern`;
CREATE TABLE `users` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`title` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`first_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`last_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`email_verified_at` timestamp NULL DEFAULT NULL,
const axios = require('axios');
const secretKey = "<PAYSTACK_SECRET_KEY>"
const initializePaystack = async (form) => {
const options = {
url : 'https://api.paystack.co/transaction/initialize',
@voidnerd
voidnerd / resetrootpassword.md
Last active August 24, 2021 07:59
reset mysql (5.7) root password on ubuntu 19.04

Step 1

sudo /etc/init.d/mysql stop

Step 2

sudo mkdir /var/run/mysqld/
@voidnerd
voidnerd / no-try-catch-async-await.js
Created April 22, 2019 12:46 — forked from DavidWells/no-try-catch-async-await.js
Nicer try/catch for async await.
/* Helper buddy for removing async/await try/catch litter 🗑 */
function O_o(promise) {
return promise.then(data => {
if (data instanceof Error) return [data]
return [null, data]
}).catch(err => [err])
}
/* Look ma, no try/catch */
async function usageExample(params) {
@voidnerd
voidnerd / fileupload.js
Last active December 20, 2018 16:05
A sample file upload using Javascrip
// example html
<input type="file" id="upload" style="display:none" name="upload">
<button id="clik"> Click to Upload Video</button>
//Start Upload
function _(el) {//helper function
return document.getElementById(el);
}