Skip to content

Instantly share code, notes, and snippets.

View Nav-Appaiya's full-sized avatar
🏠
Available

Nav Appaiya Nav-Appaiya

🏠
Available
View GitHub Profile
@Nav-Appaiya
Nav-Appaiya / change acces for user mysql
Created September 12, 2020 22:29
mysql could not authenticate sha2 password error
ALTER USER 'yourusername'@'localhost' IDENTIFIED WITH mysql_native_password BY 'youpassword';
@Nav-Appaiya
Nav-Appaiya / bootstrap-4-1-faq-example-with-tabs-and-accordions.markdown
Created July 14, 2020 12:38
Bootstrap 4.1 FAQ example with tabs and accordions

Bootstrap 4.1 FAQ example with tabs and accordions

** NEW ** Updated for Bootstrap 4.x

FAQ example with tabs and accordions in vertical navigation.

Notice: It's very important that you get the ID's right. The Bootstrap JS is matching up the accordion/collapse with data-target, and if you get them wrong, it won't work as intended.

A Pen by Morten Sørensen on CodePen.

@Nav-Appaiya
Nav-Appaiya / add-gtm-wp.php
Created June 7, 2020 14:32 — forked from jsn789/add-gtm-wp.php
Add Google Tag Manager through functions.php in WordPress
/* Add Google Tag Manager javascript code as close to
the opening <head> tag as possible
=====================================================*/
function add_gtm_head(){
?>
<!-- Google Tag Manager -->
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
@Nav-Appaiya
Nav-Appaiya / index.php
Created June 5, 2020 20:09
Password protection in PHP with basic auth (snippet for securing websiet with password in index.php)
<?php
function require_auth() {
$AUTH_USER = 'admin';
$AUTH_PASS = 'password';
header('Cache-Control: no-cache, must-revalidate, max-age=0');
$has_supplied_credentials = !(empty($_SERVER['PHP_AUTH_USER']) && empty($_SERVER['PHP_AUTH_PW']));
$is_not_authenticated = (
!$has_supplied_credentials ||
$_SERVER['PHP_AUTH_USER'] != $AUTH_USER ||
$_SERVER['PHP_AUTH_PW'] != $AUTH_PASS
@Nav-Appaiya
Nav-Appaiya / index.html
Last active May 29, 2020 10:29
New Landing Page (animated)
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.13.0/css/all.min.css" rel="stylesheet" />
<section class="showcase">
<div class="video-container">
<video src="https://traversymedia.com/downloads/video.mov" autoplay muted loop></video>
</div>
<div class="content">
<h1>Shoot For The Stars</h1>
<h3>Full screen video landing page</h3>
<a href="#about" class="btn">Read More</a>
@Nav-Appaiya
Nav-Appaiya / gist:f3a4b998fddcb3eb8411e367b90b5538
Created May 9, 2020 15:11
Add larger files to the gitignore from terminal
$ find . -size +10M | cat >> .gitignore
@Nav-Appaiya
Nav-Appaiya / docker pull kalilinux kali-linux-docker
Created April 10, 2020 11:10
docker pull kalilinuxkali-linux-docker
# pull kali docker image
docker pull kalilinux/kali-linux-docker
# run kali docker image
docker run --name kali_linux --net="host" --privileged -e DISPLAY=$DISPLAY -it -v /tmp/.X11-unix:/tmp/.X11-unix kalilinux/kali-linux-docker /bin/bash
@Nav-Appaiya
Nav-Appaiya / index.html
Created April 4, 2020 15:06
Personal Portfolio
<html>
<head>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">
<title>LucroTech's Portfolio</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="stylesheet" href="assets/css/main.css" />
</head>
@Nav-Appaiya
Nav-Appaiya / Mac terminal
Created March 21, 2020 10:56
How to download all your nest videos to your mac - steps
How to download all your nest videos to your mac using few simple steps:
1. Go to your nest dashboard and visit the page with the overview of your saved clips. The url should be /clips like:
https://home.nest.com/camera/997e8fdxxyourxvideoxxxhashxxxxxx8fdfe/clips
2. Inspect element -> copy full body of this page with all the videos listed.
Scroll down to ensure that you see all your clips on this HTML page, because you need to copy the html body.
3. Beam up sublime text or your editor where you first:
1. prettify the html -> make it readable