Skip to content

Instantly share code, notes, and snippets.

View kevinchappell's full-sized avatar
🌠

Kevin Chappell kevinchappell

🌠
View GitHub Profile
@kevinchappell
kevinchappell / .bash_profile
Created July 2, 2015 21:40
parse_git_branch() in terminal
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
PS1='${debian_chroot:+($debian_chroot)}\[\033[1;31m\]\u\[\033[1;37m\]@\[\033[1;32m\]\h\[\033[1;37m\]:\[\033[1;36m\]\w \[\033[1;35m\]$(parse_git_branch) \[\033[1;33m\]\$ \[\033[0m\]'
<?php
/**
* Super simple class for logging. Generates regular logs and csv files
* @package lightLogger
* @author Kevin Chappell <[email protected]>
* @license http://opensource.org/licenses/MIT The MIT License (MIT)
* @since lightLogger .5
*/
/**
@kevinchappell
kevinchappell / get_user_data.php
Last active June 14, 2021 04:07
Get all User data in WordPress
<?php
/**
* Get an array of all user data
* @param string|int $user_id
* @return array merged array of user meta and data
*/
function get_user_data( $user_id ){
$user_data = (array) get_userdata( $user_id )->data;
$user_meta = array_map( function( $item ){ return $item[0]; }, (array) get_user_meta( $user_id ) );
return array_merge( $user_data, $user_meta );