Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
Barely uses GitHub. My projects are elsewhere; I'm only here for issues.

Alex alexbuzzbee

💭
Barely uses GitHub. My projects are elsewhere; I'm only here for issues.
View GitHub Profile
@alexbuzzbee
alexbuzzbee / systemdAsUser.service
Last active Feb 27, 2019 — forked from torch2424/systemDAsUser.service
Run a systemd service as a user
View systemdAsUser.service
# How to create systemd services: http://neilwebber.com/notes/2016/02/10/making-a-simple-systemd-file-for-raspberry-pi-jessie/
[Unit]
Description=Run systemd service as a specific user
[Service]
User=[USER NAME]
WorkingDirectory=[DIRECTORY OF COMMAND OR USER HOME]
ExecStart=sh -c '[COMMAND TO RUN]' # Probably don't even need sh.
[Install]
@alexbuzzbee
alexbuzzbee / address.txt
Created Jul 24, 2017
Ethereum Rinkeby Testnet Faucet Address
View address.txt
0x58c991d4131d799d9DC4f5720c0AA55B29c22125
@alexbuzzbee
alexbuzzbee / Dictionary.cpp
Last active Aug 29, 2015
A simple dictionary/associative array/table (not a hash table; much less efficient than one) implemented in C++.
View Dictionary.cpp
#include <string.h>
#include <Dictionary.h>
template <T, S>
int Dictionary::getValue(char *key) {
for (i = 0; i < sizeof(this->keys) / sizeof(this->keys[0]); i++;) { // Inefficient lookup function because this isn't a hash table.
if (strcmp(this->keys[i], key)) {
return this->values[i];
}
}