NOTE: This is a question I found on StackOverflow which I’ve archived here, because the answer is so effing phenomenal.
If you are not into long explanations, see [Paolo Bergantino’s answer][2].
NOTE: This is a question I found on StackOverflow which I’ve archived here, because the answer is so effing phenomenal.
If you are not into long explanations, see [Paolo Bergantino’s answer][2].
#!/bin/bash | |
# A simple script to backup an organization's GitHub repositories. | |
# NOTE: if you have more than 100 repositories, you'll need to step thru the list of repos | |
# returned by GitHub one page at a time, as described at https://gist.github.com/darktim/5582423 | |
GHBU_BACKUP_DIR=${GHBU_BACKUP_DIR-"github-backups"} # where to place the backup files | |
GHBU_ORG=${GHBU_ORG-"<CHANGE-ME>"} # the GitHub organization whose repos will be backed up | |
# (if you're backing up a user's repos instead, this should be your GitHub username); also see the note below about the `REPOLIST` definition around line 48 | |
GHBU_UNAME=${GHBU_UNAME-"<CHANGE-ME>"} # the username of a GitHub account (to use with the GitHub API) |
/* | |
A single '#' will create a string from the given argument, | |
regardless of what that argument contains, | |
while the double '##' will create a new token by concatenating the arguments. | |
*/ | |
/* Run with compiler flag `-E` using gcc to see the pre-processor output. */ | |
#ifdef ERR | |
#error "Hey! You've got a compile time error." |
/* | |
Using _Generic() macro. | |
Code snippets are directly from: | |
http://www.robertgamble.net/2012/01/c11-generic-selections.html | |
Found this link through an answer here: | |
https://stackoverflow.com/questions/9804371/syntax-and-sample-usage-of-generic-in-c11#17290414 | |
Was introduced to this feature from: |
#include <pthread.h> | |
#include <sched.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <sys/syslog.h> | |
#define THREAD_COUNT 128 | |
static const char *g_log_header = "[MYLOGS]"; | |
typedef struct { |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <syslog.h> | |
#define NUM_THREADS 1 | |
void log_uname(void) { | |
FILE *fp; | |
const char* cmd = "uname -a"; | |
fp = popen(cmd, "r"); |
#define _GNU_SOURCE | |
#include <pthread.h> | |
#include <stdlib.h> | |
#include <stdio.h> | |
#include <sched.h> | |
#include <sys/sysinfo.h> | |
#include <sys/types.h> | |
#include <unistd.h> | |
#include <syslog.h> |
/****************************************************************************/ | |
/* Function: nanosleep and POSIX 1003.1b RT clock demonstration */ | |
/* */ | |
/* Sam Siewert - 02/05/2011 */ | |
/* */ | |
/****************************************************************************/ | |
#include <errno.h> | |
#include <pthread.h> | |
#include <stdio.h> |
name: PlatformIO CI | |
on: [push] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
if: "!startsWith(github.event.head_commit.message, 'docs')" | |
steps: |
; PlatformIO Project Configuration File | |
; | |
; Build options: build flags, source filter | |
; Upload options: custom upload port, speed and extra flags | |
; Library options: dependencies, extra library storages | |
; Advanced options: extra scripting | |
; | |
; Please visit documentation for the other options and examples | |
; https://docs.platformio.org/page/projectconf.html |