Skip to content

Instantly share code, notes, and snippets.

View bhuvidya's full-sized avatar
💭
Mainly working on Laravel packages.

bhu Boue vidya bhuvidya

💭
Mainly working on Laravel packages.
  • Freelance
  • Melbourne, Australia
View GitHub Profile
@bhuvidya
bhuvidya / macbook-m1-pro-dev-setup.md
Last active October 1, 2024 02:07
Setting up a macbook m1 pro for my dev work from scratch.

System Preferences

  • trackpad - tap to click, tracking speed fast, set all other gestures on
  • software update - turn auto update OFF
  • siri off
  • general
    • allow handoff
    • turn off "Close windows when quitting an app"
  • desktop and screensaver - setup screensaver, and hot corners: top left for screen lock, top right for put display to sleep
  • dock
@bhuvidya
bhuvidya / nuxtjs-tips-and-tricks.md
Last active March 1, 2022 05:39
nuxt.js tips and tricks
@bhuvidya
bhuvidya / laravel-helper-collection.md
Last active January 2, 2021 02:48
A collection of handy Laravel helpers. I've organised into general categories.

Laravel Helper Collection

Here is a collection of Laravel helpers you may find useful.

Dump

dump_if() - an extended dump()

<?php
@bhuvidya
bhuvidya / craft-tips.md
Last active March 17, 2022 23:52
Some notes for Craft CMS v3 plugin/module/twig reference.

Plugins / Modules

Modules

  • Get module instance: BlahModule::getInstance() or BlahModule::$instance
  • Get module service instance: BlahModule::getInstance()->myService or BlahModule::$instance->myService
  • Access module variable in twig: {{ craft.blahModule.someVar }} or {{ craft.blahModule.someVar(params) }}

Globals

@bhuvidya
bhuvidya / laravel-artisan-autocomplete.md
Last active September 11, 2023 09:42
Laravel artisan command auto-complete for BASH.

The inspiration for this comes from https://gist.github.com/jhoff/8fbe4116d74931751ecc9e8203dfb7c4

The following code gives you auto-complete for artisan commands in a BASH shell. Just add to your ~/.bash_profile. If you want a faster auto-complete, run art_cache from your project root to get a cached file of commands. To remove this file just run art_cache clear. If you haven't created a cache file, the script uses artisan list to get the command list dynamically (but this is a lot slower).

export ARTISAN_CMDS_FILE=bootstrap/cache/artisan-cmds.txt

function _artisan() {
    COMP_WORDBREAKS=${COMP_WORDBREAKS//:}
@bhuvidya
bhuvidya / bash-snippets.md
Last active May 15, 2020 00:36
Handy Bash shell code snippets.

Get script directory

$ CWD="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
@bhuvidya
bhuvidya / bash-snippets.md
Created May 15, 2020 00:35
Handy Bash shell code snippets.
# get dir of loaded script
$ CWD="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
@bhuvidya
bhuvidya / heroku-parse-local-dev-setup-macos.md
Last active May 15, 2020 01:07
Setup your macos dev machine to do local development on a Heroku nodejs/parse/mongodb application.

Local Dev Setup Heroku / Nodejs / Parse / Mongodb on macOS

I recently started doing some collaborative development work on a Heroku nodejs application that uses Parse Server with MongoDB. Even though at times it's important to share an online database for testing etc, I found I really wanted to recreate the setup locally. This would mean not having to git push heroku master every time I did the smallest code update, waiting a minute or more for the application to be compiled and deployed on heroku. As a corollary, I can do my work locally in an isolated feature branch, test locally, then merge and push when happy.

This document outlines how I set things up on my Macbook Pro, running Catalina 10.15.4.

Git

You probably already have it, but if not I use homebrew

@bhuvidya
bhuvidya / css-misc-fade-out.css
Last active April 23, 2019 10:45
CSS Miscellany - Fade Out Background
// first approach
.parent {
overflow: hidden;
position: relative;
height: 10rem;
}
.parent::after {
content: "";
position: absolute;
@bhuvidya
bhuvidya / laravel-cool-packages.md
Last active February 24, 2020 04:43
A list of the best Laravel packages.