Skip to content

Instantly share code, notes, and snippets.

View CameronNemo's full-sized avatar

Cameron Nemo CameronNemo

View GitHub Profile
#!/bin/bash
if [ $UID -gt 0 ]; then
echo "You're an idiot."
else
echo "You're a fucking idiot."
fi
@lesovsky
lesovsky / append-strings-with-snprintf.c
Created July 15, 2016 18:52
How-to append strings using snprintf (without strcat/strncat).
#include <stdio.h>
#include <string.h>
#define LOC_MAXLEN 13
int main (void)
{
char dest[LOC_MAXLEN];
snprintf(dest, LOC_MAXLEN, "%s%s", "abc", "def");