Skip to content

Instantly share code, notes, and snippets.

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

Manny Isles mannysoft

🏠
Working from home
View GitHub Profile
@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)
@hkhamm
hkhamm / installing_cassandra.md
Last active November 8, 2023 15:53
Installing Cassandra on Mac OS X

Installing Cassandra on Mac OS X

Install Homebrew

Homebrew is a great little package manager for OS X. If you haven't already, installing it is pretty easy:

ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
@ubermaniac
ubermaniac / covertToHierarchy.php
Last active April 21, 2021 14:28
Convert a DB result of parent/child items into a hierarchical array
<?php
// -- Only one caveat : The results must be ordered so that an item's parent will be processed first.
// -- Simulate a DB result
$results = array();
$results[] = array('id' => 'a', 'parent' => '', 'name' => 'Johnny');
$results[] = array('id' => 'b', 'parent' => 'a', 'name' => 'Bobby');
$results[] = array('id' => 'c', 'parent' => 'b', 'name' => 'Marky');
$results[] = array('id' => 'd', 'parent' => 'a', 'name' => 'Ricky');
@jeroenvdgulik
jeroenvdgulik / Show_current_branch_in.php
Last active November 10, 2023 09:07
Output the current branch in your PHP application
<?php
# Git branch output in PHP
exec('git symbolic-ref HEAD', $output);
$branch = end(explode('/', $output[0])));