Skip to content

Instantly share code, notes, and snippets.

{ stdenv, autoPatchelfHook }:
stdenv.mkDerivation rec {
pname = "wasmcloud-binaries";
version = "1.0";
src = ./.; # Assuming the binaries are in the current directory
nativeBuildInputs = [ autoPatchelfHook ];
#!/usr/bin/env bash
# Abort sign off on any error
set -e
# Start the benchmark timer
SECONDS=0
# Repository introspection
OWNER=$(gh repo view --json owner --jq .owner.login)
@bartholomej
bartholomej / css-media-queries-cheat-sheet.css
Last active May 6, 2024 21:51
CSS Media Query Cheat Sheet (with Foundation)
/*------------------------------------------
Responsive Grid Media Queries - 1280, 1024, 768, 480
1280-1024 - desktop (default grid)
1024-768 - tablet landscape
768-480 - tablet
480-less - phone landscape & smaller
--------------------------------------------*/
@media all and (min-width: 1024px) and (max-width: 1280px) { }
@media all and (min-width: 768px) and (max-width: 1024px) { }

Network Setup / Topology

Assuming internet facing server (VPS) is Public IP 1.2.3.4 , which is VPN server internally at 10.10.0.1

Assuming home PC is VPN client internally at 10.10.0.2 (Public IP doesn't matter)

We want to expose home PC port 6969 to the internet via the VPS's port 6969.

+---------------------+                   +----------------------+                       +----------------------+
@matt-bailey
matt-bailey / github-pages-custom-domain-gandi-dns-records.md
Last active May 6, 2024 21:44
How to set up DNS records on gandi.net to use a custom domain on Github Pages

How to set up DNS records on gandi.net to use a custom domain on Github Pages

You would think it would be easy to find this information, but none of the Github or Gandi documentation is clear so I have recorded the required steps here.

Create the following A records:

@ 1800 IN A 185.199.108.153
@ 1800 IN A 185.199.109.153
@ 1800 IN A 185.199.110.153
@toadkicker
toadkicker / zindex.scss
Last active May 6, 2024 21:42 — forked from fat/gist:1f6da6b3bd0311a1f8a0
medium's z-index scale
// Copyright 2014 A Medium Corporation
//
// z-index.less
// Medium.com's z-index scale. Z-index values should always be defined in z-index.less. This
// allows us to at a glance determine relative layers of our application and prevents bugs
// arrising from arbitrary z-index values. Do not edit the z-index scale! Only add application
// scoped z-index values.
//This is the SASS version modified by @toadkicker.
@oanhnn
oanhnn / using-multiple-github-accounts-with-ssh-keys.md
Last active May 6, 2024 21:40
Using multiple github accounts with ssh keys

Problem

I have two Github accounts: oanhnn (personal) and superman (for work). I want to use both accounts on same computer (without typing password everytime, when doing git push or pull).

Solution

Use ssh keys and define host aliases in ssh config file (each alias for an account).

How to?

  1. Generate ssh key pairs for accounts and add them to GitHub accounts.
@kachar
kachar / Link-Next13.tsx
Last active May 6, 2024 21:38
Next.js Link + Material UI Link/Button components bundled with forwardRef
@gruber
gruber / Liberal Regex Pattern for All URLs
Last active May 6, 2024 21:38
Liberal, Accurate Regex Pattern for Matching All URLs
The regex patterns in this gist are intended to match any URLs,
including "mailto:foo@example.com", "x-whatever://foo", etc. For a
pattern that attempts only to match web URLs (http, https), see:
https://gist.github.com/gruber/8891611
# Single-line version of pattern:
(?i)\b((?:[a-z][\w-]+:(?:/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))
@LogosITO
LogosITO / Vec2.hpp
Created May 6, 2024 21:34
C++ Vector2 Implementation.
#pragma once
#include <iostream>
#include <cmath>
#define W_EPS 0.000001
bool isEqual(double x, double y) {
return std::fabs(x - y) < W_EPS;
}