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
@ziadoz
ziadoz / MemberOfMacro.php
Created November 5, 2021 12:46
MySQL 8.0 JSON MEMBER OF Laravel Eloquent Macro
<?php
use Illuminate\Database\Query\Builder;
$memberOf = function ($value, string $column, string $path = '$', $boolean = 'and') {
return $this->whereRaw(
sprintf(
'? MEMBER OF(JSON_EXTRACT(%s, "%s"))',
$this->getGrammar()->wrap($column),
$path
),
@rhukster
rhukster / _README.md
Created August 19, 2020 22:15 — forked from oleq/_README.md
A2DP audio streaming using Raspberry PI (Raspbian Jessie)

What is this all about?

This tutorial will turn your Raspberry PI into a simple Bluetooth audio receiver, which plays music through connected speakers. It's like a regular car audio system, but it can be used anywhere and it's a good value.

   Audio source (i.e. smartphone) 
                |
                v
 (((  Wireless Bluetooth Channel  )))
 |
<?php
$char = 'イ';
// What's the UTF-8 encoding of this character? (This file is saved in UTF-8)
var_dump(bin2hex($char)); // e382a4
// What does another encoding look like?
// See http://www.fileformat.info/info/unicode/char/30a4/charset_support.htm
var_dump(bin2hex(mb_convert_encoding($char, "EUC-JP", "UTF-8"))); // a5a4
@ivanvermeyen
ivanvermeyen / HOWTO.md
Last active January 14, 2024 03:02
Multiple MySQL versions on MacOS with Homebrew

Update - 4 september 2020

Making multiple MySQL versions work with Homebrew was tricky to say the least. Fortunately there are 2 new easy ways that I learned of to achieve this.

DBngin app

As @4unkur and @henrytirla commented below, there is this extremely easy to use app called DBngin, which lets you setup multiple databases (not only MySQL) simultaneously using different ports:

https://dbngin.com/

@jakebathman
jakebathman / logslaravel.sh
Created August 19, 2018 00:06
Tail Laravel logs and filter out the stack traces
tail -f -n 450 storage/logs/laravel*.log \
| grep -i -E \
"^\[\d{4}\-\d{2}\-\d{2} \d{2}:\d{2}:\d{2}\]|Next [\w\W]+?\:" \
--color
@RockinPaul
RockinPaul / sourceTree_device_not_configured.txt
Last active April 15, 2024 18:35
SourceTree: Device not configured (on MacOS)
In console:
git config credential.helper
You will see: osxkeychain
git config credential.helper sourcetree
Then if you perform git config credential.helper again
You will see: sourcetree
@rhukster
rhukster / sphp.sh
Last active March 30, 2024 10:41
Easy Brew PHP version switching (Now moved to https://github.com/rhukster/sphp.sh)
#!/bin/bash
# Creator: Phil Cook
# Modified: Andy Miller
#
# >>> IMPORTANT: Moved to: https://github.com/rhukster/sphp.sh
# >>> Kept here for legacy purposes
#
osx_major_version=$(sw_vers -productVersion | cut -d. -f1)
osx_minor_version=$(sw_vers -productVersion | cut -d. -f2)
osx_patch_version=$(sw_vers -productVersion | cut -d. -f3)
@michaelneu
michaelneu / README.md
Last active December 29, 2023 04:06
A basic, but fast git prompt.

bash-basic-git-prompt

This is a considerably faster, but much more basic alternative to bash-git-prompt.

When adding this script to your .bash_profile or .bashrc, it'll display the selected branch of the current folder (if it's a git repo), and whether it's modified (yellow) or contains staged files (cyan).

example

The script makes the assumption, that a .git folder only exists when the directory is a git repo. Also, it checks for the english version of the git status command, so if you're using git in a different locale, make sure to adjust this.

@james2doyle
james2doyle / NuxtValetDriver.php
Last active July 25, 2022 16:51
A Laravel Valet driver for running generated Nuxt.js sites. This driver assumes you have not changed the default public path (/dist) in the nuxt.config.js
<?php
/**
* NuxtValetDriver for running compiled nuxt.js sites
*/
class NuxtValetDriver extends BasicValetDriver
{
/**
* Determine if the driver serves the request.
*
@yann-yinn
yann-yinn / app.css
Created August 14, 2017 11:19
Page transitions slide effect example with Nuxt.js and Vue.js
// only for desktop for now,
@media screen and (min-width: 1008px) {
/* during entering and leaving : */
.page-enter-active, .page-leave-active {
position:absolute;
max-width:725.328px; /*make sur our content keep it's original width*/
transition: all .2s ease;
}