Skip to content

Instantly share code, notes, and snippets.

View holodnak's full-sized avatar
🎯
Focusing

James Holodnak holodnak

🎯
Focusing
  • Aligned / Holodnak Electronics
  • USA
View GitHub Profile
@holodnak
holodnak / DumpHex.c
Created April 1, 2018 23:24 — forked from ccbrown/DumpHex.c
Compact C Hex Dump Function w/ASCII
#include <stdio.h>
void DumpHex(const void* data, size_t size) {
char ascii[17];
size_t i, j;
ascii[16] = '\0';
for (i = 0; i < size; ++i) {
printf("%02X ", ((unsigned char*)data)[i]);
if (((unsigned char*)data)[i] >= ' ' && ((unsigned char*)data)[i] <= '~') {
ascii[i % 16] = ((unsigned char*)data)[i];
create new rails app:
$ rails new store_name -d postgresql
in postgres:
$ psql -U postgres
$ create role store_name login createdb;
create databases:
#!/bin/bash
# Simple bash/expect script to manually upload files tracked by git.
# Written by James Holodnak -- https://github.com/holodnak
# extract parent directories from a full path
function mkdirp() {
# initialize the output variable
DIR=""