Skip to content

Instantly share code, notes, and snippets.

View andresabello's full-sized avatar
🎯
Focusing

Andres Abello andresabello

🎯
Focusing
View GitHub Profile
const path = require('path')
const {VueLoaderPlugin} = require('vue-loader')
const {CleanWebpackPlugin} = require('clean-webpack-plugin')
const CompressionPlugin = require('compression-webpack-plugin')
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
let watchOptions = {
aggregateTimeout: 300,
poll: 1000,
@andresabello
andresabello / binary-seach-tree.js
Created June 15, 2020 15:31
Binary Search Tree
class Node {
constructor(value) {
this.left = null
this.right = null
this.value = value
}
}
class BinarySearchTree {
constructor() {
@andresabello
andresabello / sum-linked-lists.js
Created June 13, 2020 03:58
Add Two Numbers #2 From Leetcode = You are given two non-empty linked lists representing two non-negative integers. The most significant digit comes first and each of their nodes contain a single digit. Add the two numbers and return it as a linked list. You may assume the two numbers do not contain any leading zero, except the number 0 itself.
/**
* Definition for singly-linked list.
* function ListNode(val, next) {
* this.val = (val===undefined ? 0 : val)
* this.next = (next===undefined ? null : next)
* }
*/
/**
* @param {ListNode} l1
* @param {ListNode} l2
@andresabello
andresabello / merge-sort.js
Last active June 7, 2020 03:16
merge-sort algorithm using Javascript
const numbers = [99, 44, 6, 2, 1, 5, 63, 87, 283, 4, 0];
function mergeSort(array) {
if (array.length === 1) {
return array
}
let half = array.length / 2
let left = array.slice(0, half)
let right = array.slice(half)
function insertionSort(array) {
const length = array.length
for (i = 0; i < length; i++) {
if (array[i] > array[i + 1]) {
let temp = array[i]
array[i] = array[i + 1]
array[i + 1] = temp
for (j = i - 1; j >= 0; j--) {
if (array[j] > array[j + 1]) {
let temp = array[j]
@andresabello
andresabello / bubble.go
Created June 6, 2020 16:40
Bubble sort algorithm
package main
import (
"fmt"
)
func main() {
unordered := []int{99, 6, 5, 88, 3, 9, 7, 11}
ordered := bubbleSort(unordered)
@andresabello
andresabello / main.go
Last active June 6, 2020 01:01
Factorial functions in go. Differnence between recursive and array
package main
import (
"fmt"
)
func main() {
number := 8
result := factorial(number)
travResult := traversal(number)
<template>
<div id="burger" :class="{
'active': active
}" @click="toggleActive">
<button type="button" class="burger-button" title="Menu">
<span class="burger-bar burger-bar--1"></span>
<span class="burger-bar burger-bar--2"></span>
<span class="burger-bar burger-bar--3"></span>
</button>
</div>
@andresabello
andresabello / SkeletonLoader.vue
Last active November 25, 2022 13:28
A skeleton loader for Vue JS. You will need to implement the setLoadingState. This one is just an example that hides the element after 5 seconds.
<template>
<div class="container">
<div class="row" v-show="loading">
<div class="col-xl-4 pt-5">
<div class="placeholder wave">
<div class="square"></div>
<div class="line"></div>
<div class="line"></div>
</div>
</div>
@andresabello
andresabello / TypingTest.vue
Created March 18, 2019 20:26
Typing Test using Vue JS Basic Component
<template>
<div class="container">
<div class="row justify-content-center">
<div class="col-md-12">
<div class="card card-default">
<div class="card-body">
<div id="word-section">
<div class="waiting">⌛</div>
</div>
<div id="type-section">