Skip to content

Instantly share code, notes, and snippets.

View nic-hartley's full-sized avatar
👀
Definitely working... I promise.

Nic Hartley nic-hartley

👀
Definitely working... I promise.
View GitHub Profile
@nic-hartley
nic-hartley / keybase.md
Created June 28, 2016 21:59
Verifying who I am

Keybase proof

I hereby claim:

  • I am newbiedoodle on github.
  • I am qpaystaxes (https://keybase.io/qpaystaxes) on keybase.
  • I have a public key whose fingerprint is 5619 F366 1B0D 7FC9 9292 BA3E 9E49 58E4 A139 C99D

To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am QPaysTaxes on github.
  • I am qpaystaxes (https://keybase.io/qpaystaxes) on keybase.
  • I have a public key whose fingerprint is 5619 F366 1B0D 7FC9 9292 BA3E 9E49 58E4 A139 C99D

To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am nic-hartley on github.
  • I am qpaystaxes (https://keybase.io/qpaystaxes) on keybase.
  • I have a public key whose fingerprint is 5619 F366 1B0D 7FC9 9292 BA3E 9E49 58E4 A139 C99D

To claim this, I am signing this object:

@nic-hartley
nic-hartley / string_escape.c
Created March 29, 2017 22:40
The escaping methods and its tests
//to simulate my environment
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
typedef unsigned long long ERROR;
const ERROR TTO_WORDS_VALUELESS_FAIL = 9000;
const ERROR TTO_UNKNOWN_TYPE_FAIL = 9001;
const ERROR TTO_NOT_IMPLEMENTED_FAIL = 9002;
const ERROR TTO_CREATE_OBJ_FAIL = 9003;
const ERROR TTO_STRING_ESCAPE_FAIL = 9004;
@nic-hartley
nic-hartley / ColoredWalker.cs
Created March 30, 2017 07:47
A full program for a WinForms-based app that draws a few colorful Drunkards' Walks.
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Windows.Forms;
namespace ColorWalker
{
class Walker
{
private int _lastX = 0, _lastY = 0;
@nic-hartley
nic-hartley / clicommands.js
Created May 3, 2017 05:17
A NodeJS mini-module-thing that allows fairly simple handling of command-line commands for your server
((initialCommands, undefined) => {
const readline = require('readline');
let commands = typeof initialCommands !== 'object' ? {} : initialCommands;
function replaceCommand(name, func) {
commands[name] = [func];
}
function addCommand(name, func) {
@nic-hartley
nic-hartley / settings.json
Created May 10, 2017 06:06
My VS Code settings as they are now.
{
"diffEditor.ignoreTrimWhitespace": false,
"editor.acceptSuggestionOnCommitCharacter": false,
"editor.detectIndentation": false,
"editor.fontSize": 12,
"editor.fontFamily": "Source Code Pro, 'Courier New', monospace",
"editor.formatOnType": true,
"editor.insertSpaces": true,
"editor.minimap.enabled": true,
"editor.minimap.renderCharacters": false,
/*
This gist demonstrates an issue with Clang-Tidy, I think.
Basically, you shouldn't be required to initialize all members of a
union, for obvious reasons, but Clang-Tidy doesn't care that the
"missing" members are part of a union, and tries to get them to be
initialized anyway.
*/
struct Type {

General notes, first:

  • Each of these blocks runs repeatedly on its own thread.
    • There might be some delay (to let queues refill, or to keep from getting ratelimited by Reddit, or whatever) between each run; in theory, that shouldn't matter to the actual operation.
    • Some additional boilerplate is probably also required (checking if they're empty, etc.) but screw writing all that
  • Anything before .push or .pop is a queue
  • logging and metrics have been intentionally omitted; they can be added where necessary.

asdf asdf fkjdkjf