Skip to content

Instantly share code, notes, and snippets.

View connorjclark's full-sized avatar

Connor Clark connorjclark

View GitHub Profile
reillyeon /
Last active February 22, 2022 16:05
When does an async function return?

When does an async function return?

Someone recently asked me when an async function in JavaScript "returns". This is an interesting question because while a function like f() below has a return statement in it, f() actually returns much earlier than that. To understand how this works, let's take a look at an example function. Here, a() and c() are normal synchronous functions and b() is another asynchronous function.

async function f() {
  await b();
  return c();
jimmywarting / custom json replacer
Last active August 15, 2022 10:25
Custom json replacer/reviver with extended support
View custom json replacer

This custom json replacer/reviver allow you to store more types as json and still keep it as valid json.


  • Allow you to stringify/parse
    • BigInt
    • Infinity
    • NaN
    • Date
    • typed arrays & ArrayBuffers as web-safe base64
View csp-bypass.js
const linkEl = document.createElement('link');
linkEl.rel = 'prefetch';
linkEl.href = urlWithYourPreciousData;
ageis /
Last active February 21, 2024 21:49
Options for hardening systemd service units

security and hardening options for systemd service units

A common and reliable pattern in service unit files is thus:

wu-sheng /
Created December 21, 2016 06:30 — forked from codefromthecrypt/
My ramble on OpenTracing (with a side of Zipkin)

I've had many people ask me questions about OpenTracing, often in relation to OpenZipkin. I've seen assertions about how it is vendor neutral and is the lock-in cure. This post is not a sanctioned, polished or otherwise muted view, rather what I personally think about what it is and is not, and what it helps and does not help with. Scroll to the very end if this is too long. Feel free to add a comment if I made any factual mistakes or you just want to add a comment.

So, what is OpenTracing?

OpenTracing is documentation and library interfaces for distributed tracing instrumentation. To be "OpenTracing" requires bundling its interfaces in your work, so that others can use it to time distributed operations with the same library.

So, who is it for?

OpenTracing interfaces are targeted to authors of instrumentation libraries, and those who want to collaborate with traces created by them. Ex something started a trace somewhere and I add a notable event to that trace. Structure logging was recently added to O

carlos-jenkins /
Last active August 10, 2023 22:12
Delegating script for multiple git hooks
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (C) 2015-2017 Carlos Jenkins <>
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
rctay /
Created December 19, 2015 15:20 — forked from UniIsland/
Simple Python Http Server with Upload
#!/usr/bin/env python
"""Simple HTTP Server With Upload.
This module builds on BaseHTTPServer by implementing the standard GET
and HEAD requests in a fairly straightforward manner.
paulirish / bling.js
Last active February 20, 2024 14:11
bling dot js
View bling.js
/* bling.js */
window.$ = document.querySelectorAll.bind(document);
Node.prototype.on = window.on = function (name, fn) {
this.addEventListener(name, fn);
NodeList.prototype.__proto__ = Array.prototype;
dtao /
Created May 25, 2012 16:10
Sublime Text plugin to increment/decrement all selected numbers
import sublime
import sublime_plugin
class NumberCommand(sublime_plugin.TextCommand):
def run(self, edit):
selection = self.view.sel()
for region in selection:
value = int(self.view.substr(region))
self.view.replace(edit, region, str(self.op(value)))
rndmcnlly / chromatic-maze-generator.lp
Created August 31, 2010 05:06
chromatic maze generator in ASP
View chromatic-maze-generator.lp
%%%% A chromatic maze generator
% By Adam M. Smith (
% This answer set program was designed to work with the Potassco (the Potsdam
% Answer Set Solving Collection) tools, namely "clingo".
%% Chromatic Mazes