Skip to content

Instantly share code, notes, and snippets.

View Akumzy's full-sized avatar
💭
👨‍💻️ Building stuffs

Akuma Isaac Akuma Akumzy

💭
👨‍💻️ Building stuffs
View GitHub Profile
@Akumzy
Akumzy / test.yaml
Created April 16, 2021 15:38 — forked from 2color/test.yaml
How to run integration tests with PostgreSQL and Prisma on GitHub Actions
# .github/workflows/test.yaml
name: test
on: push
jobs:
test:
runs-on: ubuntu-latest
# Service containers to run with `container-job`
services:
# Label used to access the service container
postgres:
@Akumzy
Akumzy / social-share.ts
Last active January 16, 2021 21:38
The socialShare function will return the right platform link
interface SocialsOptions {
text?: string
url: string
hashtags?: string
title?: string
}
export function socialShare(
data: SocialsOptions | string,
platform:
| 'twitter'
@Akumzy
Akumzy / index.html
Created May 7, 2020 07:06
HTML render function
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
.card {
padding: 1rem;
@Akumzy
Akumzy / jitsimeet-external-api.d.ts
Created May 1, 2020 09:43
JitsiMeetExternalAPI type definition
import EventEmitter from 'events'
declare class JitsiMeetExternalAPI extends EventEmitter {
constructor(
domain: string,
options: {
/**The name of the room to join. */
roomName: string
/**Width of the iframe. Check parseSizeParam for format details*/
width?: string | number
@Akumzy
Akumzy / index.js
Created December 28, 2019 09:50
Array and String reverse with recursion
function reverse(/**@type {string}*/ word, index = word.length) {
let newPos = word.length - index;
let letters = word.split("");
let tempLetter = word[newPos];
letters[newPos] = word[index - 1];
letters[index - 1] = tempLetter;
if (Math.round(word.length / 2) === index) return word;
return reverse(letters.join(""), index - 1);
}
@Akumzy
Akumzy / main.go
Last active December 27, 2019 12:30
How to create Windows Explorer shell folder in Go
package main
import (
reg "golang.org/x/sys/windows/registry"
)
func createWindowsShellFolder(GUID, folderTitle, folderPath, folderIconPath string) (err error) {
var (
localKey, rootKey, tempKey reg.Key
exists bool
@Akumzy
Akumzy / luhn.js
Last active July 16, 2019 07:42
The Luhn Algorithm in JavaScript
/**
* @param {number[]} digits
*/
function luhn(digits) {
digits = digits.reverse()
for (const index in digits) {
if (index % 2) {
const doubled = digits[index] * 2
digits[index] = doubled > 9 ? doubled - 9 : doubled
}
<template>
<div class="hello">
<h1>{{ msg }}</h1>
<h2>Essential Links</h2>
<p>right-click on any link</p>
<ul>
<li><a href="https://vuejs.org" target="_blank"> Core Docs </a></li>
<li><a href="https://forum.vuejs.org" target="_blank"> Forum </a></li>
<li>
<a href="https://chat.vuejs.org" target="_blank"> Community Chat </a>
@Akumzy
Akumzy / App.vue
Created January 1, 2019 16:07
How to create custom context-menu in vue
<template>
<div id="app">
<img width="25%" src="./assets/logo.png" /> <HelloWorld />
<!-- Add the component at your app root component -->
<ContextMenu />
</div>
</template>
<script>
import HelloWorld from "./components/HelloWorld";
@Akumzy
Akumzy / ContextMenu.vue
Created January 1, 2019 16:05
How to create custom context-menu in vue
<template>
<div
class="ctx-menu"
:style="style"
:hidden="!ctxMenuData"
v-click-outside="resetCtx"
>
<!-- Check if there are options data -->
<template v-if="ctxMenuData">
<!-- Use template tag to loop through the options -->