Skip to content

Instantly share code, notes, and snippets.

So, your program has dependencies, like tokio or openSSL. All of your dependencies are kind of like mini-programs that can be compiled by themselves. But to be useful, your program needs to be able to find and call the functions in your dependencies. To do this, a program called a linker exists - it effectively adds your program and all of your dependencies all together in one big file, and renames all the functions so that they call each other correctly.

You don't always want to include every dependency in your binary, though, so there are two sub-types of linking - static linking and dynamic linking. Static linking happens when you compile your program - by default, crates in Rust are statically linked. On the other hand, dynamic linking happens when the operating system tries to load your program. The system looks for all the libraries that your program says it needs, and links the versions it finds in.

Using a distroless base image gave you those errors because the dynamic linker couldn't find the lib

@JadedBlueEyes
JadedBlueEyes / pagerank-graphology.js
Created March 28, 2023 19:35
Pagerank implemented in plain JS and with graphology.js
import Graph from "graphology";
const defaultDampening = 0.85;
const defaultIterations = 40
// graph, or page map: the pages that exist, and that each page links to
/**
*
* @param {Graph} graph
* @param {number} iterations
@JadedBlueEyes
JadedBlueEyes / README.md
Last active February 11, 2023 12:55
Quizlet match timer pauser

Instructions:

Way One: Quick way

  1. Open the match page.
  2. Copy the code below, paste this into the URL bar.

Way Two: Bookmarklet

  1. Make a new bookmark in your browser (right-click on the bookmarks bar and click Add Page...)
  2. For the "Name" put "Quizlet Timer Pauser".
  3. Copy the code below, paste this into the "Location" of a new bookmark.
  4. Open the match page.
  5. Open the bookmark on the same page.
style = document.createElement('STYLE');
style.type = 'text/css';
style.appendChild(document.createTextNode("body{background-color: #333}canvas{position: absolute;top: 50%;left: 50%;transform: translate(-50%, -50%);}"));
document.head.appendChild(style);
@JadedBlueEyes
JadedBlueEyes / feed.json
Last active December 24, 2018 22:00
A pure liquid JSONFeed for Jekyll.
---
layout: none
---
{
"version": "https://jsonfeed.org/version/1",
"title": {{ site.title | jsonify }},
"description": {{ site.description | jsonify }},
"home_page_url": "{{ '/' | absolute_url }}",
"feed_url": "{{ '/feed.json' | absolute_url }}",
"favicon": "{{ '/favicon-32x32.png' | absolute_url }}",