Skip to content

Instantly share code, notes, and snippets.

@iNamik
iNamik / docker_compose-Makefile
Last active January 22, 2024 13:12
Makefile To Help Manage Docker-Compose Services
##
# Makefile to help manage docker-compose services
#
# Built on list_targets-Makefile:
#
# https://gist.github.com/iNamik/73fd1081fe299e3bc897d613179e4aee
#
.PHONY: help about args list targets services build up down rebuild clean start status ps logs stop restart sh bash shell
# If you need sudo to execute docker, then udpate these aliases
@iNamik
iNamik / list_targets-Makefile
Last active November 17, 2023 12:27
Base Makefile With Ability To List Targets
##
# Base Makefile with ability to list targets
#
.PHONY: help about list targets
ME := $(realpath $(firstword $(MAKEFILE_LIST)))
# Contains trailing '/'
#
PWD := $(dir $(ME))
@iNamik
iNamik / C64_Palette-c64wiki.gpl
Last active April 30, 2018 17:55
C64 Color Palette | Gimp Palette Format | http://www.c64-wiki.com/wiki/Color
GIMP Palette
Name: C64 Palette
Columns: 0
# https://www.c64-wiki.com/wiki/Color
0 0 0 Untitled
255 255 255 Untitled
136 0 0 Untitled
170 255 238 Untitled
204 68 204 Untitled
0 204 85 Untitled
@iNamik
iNamik / rpi_backlight_brightness.sh
Last active April 26, 2018 00:14
Bash Script to Set The Brightness on the Raspberry Pi Touch Screen
#!/bin/bash
FILE="/sys/class/backlight/rpi_backlight/brightness"
if [ $# = 0 ]; then
cat ${FILE}
exit 0
fi
if [ $# -eq 1 ] && [[ $1 =~ ^[0-9]{1,3}$ ]] && [ $1 -ge 0 ] && [ $1 -le 255 ]; then
@iNamik
iNamik / chrome.sh
Created May 11, 2017 21:46
Launch Multiple Chrome Instances on MAC
#
# Add the below chrome() function to your ~/.bash_profile
#
# Launch an anonymous instance - Profile is stored in /tmp with random name
# $ chrome
#
# Launch/relaunch a temporary named instance - Profile is stored in /tmp with specified name
# $ chrome name_in_all_lowercase
#
# Launch/relaunch a permanent named instance - Profile is stored in ~/Documents/ChromeProfiles with specified name
@iNamik
iNamik / keybase.md
Created February 9, 2017 19:21
keybase.md

Keybase proof

I hereby claim:

To claim this, I am signing this object:

@iNamik
iNamik / svnCleanUpdate.sh
Created April 16, 2014 06:10
Bash Script to Cleanup an SVN checkout, Revert local changes and Update to @Head - Does not generate any output unless something is changed.
#!/bin/bash
##
# svnCleanUpdate
#
# Cleanup an SVN checkout, Revert local changes and update to @HEAD
# Does not generate any output unless something is changed.
# NOTE: This script destroys all local mods - run it with caution!
#SVN_AUTH="--username user --password passwd"
@iNamik
iNamik / llrb.go
Created June 23, 2013 07:25
A base implementation of Robert Sedgewick's Left-Leaning Red-Black Tree (LLRB), written in Go (GOLANG). LLRB Trees are a variant of red-black trees with the aim of reducing the complexity of Insert and Delete functionality. They are self-balancing, maintaining the balance characteristics of a 2-3 tree, while retaining the Get(Key) performance of…
/*
package llrb implements a Left-Leaning Red-Black Tree (2-3 Variant),
as described by Robert Sedgewick:
* http://www.cs.princeton.edu/~rs/talks/LLRB/RedBlack.pdf
* http://en.wikipedia.org/wiki/Left-leaning_red%E2%80%93black_tree
The goal of this implementation is a one-to-one correlation to the ideas
@iNamik
iNamik / is_scalar_array.php
Last active December 10, 2015 02:58
I Present several PHP functions for determining if an array is 'scalar', with differing levels of strictness.
<?php
/**
* Since PHP stores all arrays as associative internally, there is no proper
* definition of a scalar array.
*
* As such, developers are likely to have varying definitions of scalar array,
* based on their application needs.
*
* In this file, I present 3 increasingly strict methods of determining if an
* array is scalar. I feel these methods cover the majority, if not all, of the
@iNamik
iNamik / PHPUnit_GenericException.php
Created December 15, 2012 19:20 — forked from anonymous/PHPUnit_GenericException.php
Generic Exception Support for PHPUnit < v3.7 - A full test suite is included.
<?php
/**
* Generic Exception Support for PHPUnit < v3.7
*
* These classes help you test generic exceptions in PHPUnit versions less than
* v3.7, avoiding the 'You must not expect the generic exception class' error.
*
* We create a new exception to represent the generic exception, and provide
* multiple ways to incorporate the functionality into your tests:
*