Skip to content

Instantly share code, notes, and snippets.

View coreybutler's full-sized avatar
⏱️
Working on Author (Runtime, Journal)

Corey Butler coreybutler

⏱️
Working on Author (Runtime, Journal)
View GitHub Profile
@coreybutler
coreybutler / main.go
Created August 12, 2023 20:38 — forked from KatelynHaworth/main.go
Example of run an interactive process on the current user from system service on windows (Golang)
package main
import (
"github.com/kardianos/service"
"log"
"flag"
)
type Service struct {}
@coreybutler
coreybutler / notifyAddrChange.go
Created August 12, 2023 20:38 — forked from KatelynHaworth/notifyAddrChange.go
A simple go program leveraging the Window API to listen for IPv4 network address change events
package main
import (
"log"
"syscall"
"unsafe"
"golang.org/x/sys/windows"
)
@coreybutler
coreybutler / js.md
Last active January 14, 2023 19:16
JavaScript Architecture
graph BT
    subgraph core[ ]
      direction BT
      subgraph rt[ ]
        %% direction TB
        cfw[Cloudflare Workers\nRuntime]
        bun[Bun\nRuntime]
        node[Node.js\nRuntime]
        deno[Deno\nRuntime]
@coreybutler
coreybutler / simple-shell-example.html
Created June 23, 2022 01:33
A basic implementation of the shell in the browser
<html>
<head>
<title>Shell Example</title>
<style>
.answer {
padding: 12px 0;
font-weight: bold;
}
.command {
@coreybutler
coreybutler / postgres-nanoid.sql
Last active December 29, 2022 22:25
PostgreSQL NANOID
CREATE FUNCTION "nanoid"("size" int4 DEFAULT 21)
RETURNS text
LANGUAGE plpgsql
STABLE
AS
$$
DECLARE
id text := '';
i int := 0;
urlAlphabet char(64) := 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_0123456789';
@coreybutler
coreybutler / tls-client.go
Created September 13, 2021 04:45 — forked from michaljemala/tls-client.go
SSL Client Authentication Golang sample
package main
import (
"crypto/tls"
"crypto/x509"
"flag"
"io/ioutil"
"log"
"net/http"
)
@coreybutler
coreybutler / answer.md
Last active May 23, 2021 14:03
What is the difference between JavaScript and Node.js?

(Original question at https://www.quora.com/What-is-the-difference-between-JavaScript-and-Node-js/)

There are some good prior answers, but they’re slightly outdated now.

JavaScript is a language, or more precisely, an implementation of ECMAScript. It is governed by a group known as TC39.

Node.js is a runtime. It’s written in C++. It was originally built on top of Chrome’s V8 JavaScript engine. Today, Node supports something known as N-API. This allows it to run atop other JavaScript engines (Microsoft’s Chakra is the first). However; the interesting parts of Node have always been the “add-on” stuff it provides, which is a library known as libuv.

Different runtimes implement different features. JavaScript is just the langua

@coreybutler
coreybutler / README.md
Last active February 20, 2017 03:28
NGN Includes Example

Github gists don't support folders, so the code uses hyphens to dilineate where a directory should be. The directory structure should loook something like:

  • root
    • lib
      • app.js
    • templates
      • header.html
      • footer.html
  • index.html
@coreybutler
coreybutler / all.json
Last active July 20, 2016 03:37
Documentation Metadata Generator
{
"classes": {
"Test": {
"line": 11,
"description": "This is a test class. No extension.",
"tags": {},
"exceptions": [],
"events": {},
"extends": "john",
"methods": {
@coreybutler
coreybutler / nested.html
Created July 10, 2016 00:47
Nested NGN.DATA.Store example
<html>
<body>
Test
<script src="./init/core.js"></script>
<script src="./shared/core.js"></script>
<script src="./ngn.js"></script>
<script src="./eventemitter.js"></script>
<script src="./bus.js"></script>
<script src="./shared/exception.js"></script>
<script src="./init/exception.js"></script>