Skip to content

Instantly share code, notes, and snippets.

View KinyuaMwaniki's full-sized avatar

Kinyua Mwaniki KinyuaMwaniki

View GitHub Profile
var oldArray = [1,2,3,4,5,6,7,8,9,10];
// We declare our newArray which holds the .filter method, filter proceeds to grab each element in our array,
// and pass them as arguments to the function which returns our result.
var newArray = oldArray.filter( function(a) {
return a < 6;
});
@KinyuaMwaniki
KinyuaMwaniki / gist:8450ba830ea8b8b02ed5fd02955f1a5e
Created May 6, 2021 14:46
Find object in array of objects
this.selectedUser = this.users.find((user) => {
return user.name === this.highlightedUsername;
});
@KinyuaMwaniki
KinyuaMwaniki / gist:737893738adbcc3aa4c54add6ee184a4
Last active May 6, 2021 14:50
Scrollable html table vue and javascript
<template>
<breeze-authenticated-layout>
<template #header>
<h2 class="font-semibold text-xl text-gray-800 leading-tight">
Dashboard
</h2>
</template>
<div class="py-12">
<div class="mb-6 max-w-7xl mx-auto sm:px-6 lg:px-8">
<div class="bg-white overflow-hidden shadow-sm sm:rounded-lg">
@KinyuaMwaniki
KinyuaMwaniki / install-laravel-project.sh
Created February 17, 2021 21:19 — forked from cse031sust02/install-laravel-project.sh
Bash Script to install Laravel project from Git on LEMP stack
#!/bin/sh
########################################################
# Bash script to install HeavyGari Laravel App
# Written by Talha Ibne Imam
########################################################
HC='\033[0;32m' # Heading Color
WC='\033[0;33m' # Warning Color
NC='\033[0m' # No Color