Skip to content

Instantly share code, notes, and snippets.

@michabbb
michabbb / docker-ps-small.sh
Created November 8, 2023 00:13
an example of how to reformat the output of "docker ps" for smaller screens
#!/bin/bash
# Color codes
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
NC='\033[0m' # No Color
# Header in green
echo -e "${GREEN}IMAGE\t\t\t\t\t\t\tSTATUS${NC}"
@partkyle
partkyle / the_silver_searcher
Last active December 11, 2018 13:07
install the silver searcher locally
# requires apt-get install -y automake pkg-config libpcre3-dev zlib1g-dev liblzma-dev
set -e
VERSION=0.16
export LOCAL=$HOME/local
mkdir -p $HOME/build
cd $HOME/build
@stevegrunwell
stevegrunwell / get_current_git_commit.php
Created August 15, 2012 21:44
Get current git HEAD using PHP
<?php
/**
* Get the hash of the current git HEAD
* @param str $branch The git branch to check
* @return mixed Either the hash or a boolean false
*/
function get_current_git_commit( $branch='master' ) {
if ( $hash = file_get_contents( sprintf( '.git/refs/heads/%s', $branch ) ) ) {
return $hash;
} else {