Skip to content

Instantly share code, notes, and snippets.

View manuelgeek's full-sized avatar
😎
#mANuEl💯

Magak Emmanuel manuelgeek

😎
#mANuEl💯
View GitHub Profile
components
Form
Form.tsx
Form.hook.tsx
index.tsx
Form.helpers.tsx
Form.types.tsx
Components
Steps
Step1.tsx
// Online Javascript Editor for free
// Write, Edit and Run your Javascript code using JS Online Compiler
// Write a fuction that adds numbers in array using recusrion. It should return 0 when array is empty.
// Do not use any of the loops
const list = [1,2,3]
function add(list){
if(!list.length) return 0
const sum = list[0] + add(list.slice(1))
@manuelgeek
manuelgeek / code.sh
Created September 22, 2022 19:53
VS Code Extensions
code --install-extension aaron-bond.better-comments
code --install-extension abusaidm.html-snippets
code --install-extension Angular.ng-template
code --install-extension apollographql.vscode-apollo
code --install-extension bradlc.vscode-tailwindcss
code --install-extension BriteSnow.vscode-toggle-quotes
code --install-extension bwildeman.tabulous
code --install-extension capaj.graphql-codegen-vscode
code --install-extension christian-kohler.npm-intellisense
code --install-extension christian-kohler.path-intellisense
@manuelgeek
manuelgeek / function_solution.js
Last active September 15, 2022 18:07
Disk Space Analysis
// solution([1,12,121,15,67])
function solution(A) {
const newArr = A.sort(function (a, b) { return a - b; });
for (let i = 0; i < newArr.length - 1; i++) {
console.log(Math.abs(newArr[i] - newArr[i + 1]))
if (Math.abs(newArr[i] - newArr[i + 1]) === 1) {
console.log(true)
return true
}
@manuelgeek
manuelgeek / blocks.js
Last active September 15, 2022 19:01
Toptal codility
// There are N blocks, numbered from 0 to n-1, arranged in a row.
// A couple of frogs were sitting together on one block when they had a
// terrible. Now they want to jump away from one another so that the
// distance between them will be as large as possible. The distance between
// blocks numbered J and K, where J <= K, is computed as K -J+1
function solutions(blocks) {
let ans= 0;
for(let i=0; i<blocks.length; i++){
let leftMax=i;
@manuelgeek
manuelgeek / mix_format_script.sh
Created August 18, 2021 13:36 — forked from bahodge/mix_format_script.sh
Find or Create .formatter.exs script that makes one in the current directory
#!/bin/sh
current=$(pwd)
formatter_file=".formatter.exs"
echo $current
if [ -e $current/"$formatter_file" ];
then
mix format
echo "Formatting Complete"
<x-layout>
<x-section>
<x-tabs active="First">
<x-tab name="First">
First content goes here.
</x-tab>
<x-tab name="Second">
Second content goes here.
</x-tab>
@manuelgeek
manuelgeek / index.js
Created April 16, 2021 09:20 — forked from acfatah/index.js
Quasar Vue Router Middleware Pipeline Example
// router/index.js
import Vue from 'vue'
import VueRouter from 'vue-router'
import routes from './routes'
import middlewarePipeline from './middleware-pipeline'
Vue.use(VueRouter)
@manuelgeek
manuelgeek / deploy.yml
Created February 2, 2021 12:11
Github Actions deploy Nuxt/Quasar SSR
name: Deploy to Staging
on:
push:
branches:
- dev
jobs:
tests-and-lints:
@manuelgeek
manuelgeek / FileUpload.vue
Last active April 29, 2021 19:32
FileUpload.vue and FileUploadCompress.vue
<template>
<div class="tw-flex tw-content-between tw-flex-wrap">
<v-card class="tw-rounded-lg c-bg-gray tw-flex tw-justify-center tw-flex-wrap" :flat="true">
<div class="image-preview tw-px-8 md:tw-px-12 tw-py-2" v-if="imageData.length > 0">
<div v-if="allowDelete" class="tw-w-full tw-flex tw-justify-end tw-absolute tw--ml-20 tw--mt-3">
<v-icon class="tw-bg-red-700 tw-rounded-full tw-p-1 tw-cursor-pointer" title="remove image" size="17" color="#fff" @click="deleteImage">mdi-close</v-icon>
</div>
<img class="preview" :src="imageData" alt="img" />
</div>
<label v-else class="tw-flex tw-items-center tw-px-8 md:tw-px-12 tw-py-4 md:tw-py-8 tw-cursor-pointer">