Skip to content

Instantly share code, notes, and snippets.

View coolaj86's full-sized avatar
😎
🐹 Go 🦎 Zig 📦 Node 🐧 POSIX 🪟 PowerShell

AJ ONeal coolaj86

😎
🐹 Go 🦎 Zig 📦 Node 🐧 POSIX 🪟 PowerShell
View GitHub Profile

How to install SSH and Load Public Keys

Install OpenSSH Server

  1. Open Admin PowerShell
  2. Run the following command
Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0
  1. Enable the services
Set-Service -Name ssh-agent -StartupType `Automatic`
@coolaj86
coolaj86 / Go-Cheatsheet.md
Last active August 3, 2022 21:17
Golang Cheatsheet

What Hiring Should Look Like

This is definitely not the first time I've written about this topic, but I haven't written formally about it in quite awhile. So I want to revisit why I think technical-position interviewing is so poorly designed, and lay out what I think would be a better process.

I'm just one guy, with a bunch of strong opinions and a bunch of flaws. So take these suggestions with a grain of salt. I'm sure there's a lot of talented, passionate folks with other thoughts, and some are probably a lot more interesting and useful than my own.

But at the same time, I hope you'll set aside the assumptions and status quo of how interviewing is always done. Just because you were hired a certain way, and even if you liked it, doesn't mean that it's a good interview process to repeat.

If you're happy with the way technical interviewing currently works at your company, fine. Just stop, don't read any further. I'm not going to spend any effort trying to convince you otherwise.

@whiteinge
whiteinge / hello-report.txt
Last active May 11, 2024 16:36
File sizes for "hello world" in various comple-to-C and compile-to-binary languages
Default compiler settings used, unless noted otherwise. Host system is Fedora
x86_64. Linked libs produced via `ldd`.
Linked libs common to all below: linux-vdso libc ld-linux
Size Lang Specific libs Common libs
18K c - -
20K luastatic liblua libm libdl
22K vala libgobject libglib libffi libpcre libpthread
/**
* @return {boolean} true whether inside a node application or not.
**/
function isNode () {
try {
return "object" === typeof process && Object.prototype.toString.call(process) === "[object process]";
} catch(e) {}
return false;
}
@mvndaai
mvndaai / tabletest.go
Last active May 27, 2020 03:54
Go table test
package tabletest
import "errors"
//ForceError will return an error if the boolean is true
func ForceError(force bool) error {
if force {
return errors.New("forced error")
}
return nil
@dominictarr
dominictarr / readme.md
Created November 26, 2018 22:39
statement on event-stream compromise

Hey everyone - this is not just a one off thing, there are likely to be many other modules in your dependency trees that are now a burden to their authors. I didn't create this code for altruistic motivations, I created it for fun. I was learning, and learning is fun. I gave it away because it was easy to do so, and because sharing helps learning too. I think most of the small modules on npm were created for reasons like this. However, that was a long time ago. I've since moved on from this module and moved on from that thing too and in the process of moving on from that as well. I've written way better modules than this, the internet just hasn't fully caught up.

@broros

otherwise why would he hand over a popular package to a stranger?

If it's not fun anymore, you get literally nothing from maintaining a popular package.

One time, I was working as a dishwasher in a restu

@kivikakk
kivikakk / whitelist.md
Created November 16, 2018 02:18
HTML sanitizer whitelist for user content on GitHub.com
  • Any allowed id and name attributes have "user-content-" prefixed to their value.
  • A maximum of 2 nested sub or sup tags are allowed.
  • A maximum of 10 nested ul or ol tags are allowed.
Allowed Element Allowed Attributes
All allowed elements abbr, accept, accept-charset, accesskey, action, align, alt, axis, border, cellpadding, cellspacing, char, charoff, charset, checked, clear, color, cols, colspan, compact, coords, datetime, dir, disabled, enctype, for, frame, headers, height, hreflang, hspace, id, ismap, itemprop, label, lang, maxlength, media, method, multiple, name, nohref, noshade, nowrap, open, prompt, readonly, rev, rows, rowspan, rules, scope, selected, shape, size, span, start, summary, tabindex, title, type, usemap, valign, value, vspace, width
a As above plus href (must be github-mac, github-windows, http,
function toBaseN(num, base) {
if (num === 0) {
return '0';
}
var digits = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
var len = Math.min(digits.length, base);
var result = '';
while (num > 0) {
result = digits[num % len] + result;
num = parseInt(num / len, 10);

tldr: go build only produces an executable for main packages. Check the package name of your main file is main.

I am an idiot. Its only through mistakes that you learn tho. I have recently been running into issues with my new golang projects. ONLY the new ones. Whenever I try to make a new project, it would always have issues. The biggest issue is the fact that "go build" would not produce an executable without "-o main.exe" as arguments. When an executable was produced, if I ran it I got

$ ./main.exe
./main.exe: line 1: syntax error near unexpected token \`newline\'
./main.exe: line 1: \`!<arch>\'