Skip to content

Instantly share code, notes, and snippets.

View lakhbawa's full-sized avatar
🏠
Working from home

Lakhveer Bawa lakhbawa

🏠
Working from home
View GitHub Profile
@lakhbawa
lakhbawa / tree.php
Last active November 13, 2021 08:32
Binary Tree Data Structure Using PHP
<?php
// https://www.baeldung.com/java-binary-tree
class Node {
public $left, $right;
public $value;
public function __construct($value) {
$this->value = $value;
$this->left = null;
$this->right = null;
}
@lakhbawa
lakhbawa / mysql-docker.sh
Last active October 10, 2020 14:09
Mysql backup database from Running Container with Time and Date
# Backup the Database
docker exec CONTAINER mkdir -p /backups | mysqldump -u root --password='PASSWORD_HERE' DATEBASE_NAME_HERE | gzip > /backups/backup_DATABASE_NAME_$(date +%Y_%m_%d__%H_%M_%S).sql.gz
@lakhbawa
lakhbawa / AnyVueComponent.vue
Created August 11, 2020 13:45
Vuex Design for better maintainability and reusability
this.$store
.dispatch('modules/auth/switchAccount', {
queryParams: {
new_account_type: newAccountType,
},
})
.then((response) => {
if (response.success) {
this.$buefy.toast.open({
message: response.message,
@lakhbawa
lakhbawa / LoadingGoogleMapsMixin.vue
Last active May 10, 2022 19:15
Adding Google Maps to NuxtJs
<script>
const apiKey = process.env.GOOGLE_MAPS_API_KEY
export default {
props: {},
computed: {},
methods: {
injectGoogleMapsApiIfNotInjectedAlready() {
return new Promise((resolve, reject) => {
try {
@lakhbawa
lakhbawa / spacing.css
Last active August 6, 2020 16:01
Advanced Spacing helpers with Responsiveness SASS and CSS
.ma-0 {
margin: 0rem;
}
.pa-0 {
padding: 0rem;
}
@media only screen and (min-width: 576px) {
.ma-0-xs {
In this webinar recording, Gary Hockin covers the fundamentals of installing and configuring Xdebug, configuring PhpStorm to listen to Xdebug, and then goes into step debugging of some scripts to find the problems. Debugging PHP is an incredibly easy and powerful tool when you
@lakhbawa
lakhbawa / .gitignore
Created December 6, 2018 14:10 — forked from smebberson/.gitignore
Express simple authentication example
node_modules
*.swp