Skip to content

Instantly share code, notes, and snippets.

View criskell's full-sized avatar

criskell

View GitHub Profile
@algebraic-dev
algebraic-dev / inet.rs
Created June 4, 2023 14:17
Interaction Net Reducer Algorithm based on Taelin's algorithm
// An address is just a pointer to some agent inside the interaction net.
#[derive(Clone, Copy, PartialEq, Eq)]
pub struct Address(usize);
/// A slot is part of an agent that can connect to other ports.
#[derive(Clone, Copy, PartialEq, Eq)]
pub struct Slot(usize);
impl Slot {
/// The main port is always zero
@rphlmr
rphlmr / clear-db.ts
Last active July 8, 2025 19:14
Drizzle snippets
// Credits to Louistiti from Drizzle Discord: https://discord.com/channels/1043890932593987624/1130802621750448160/1143083373535973406
import { sql } from "drizzle-orm";
const clearDb = async (): Promise<void> => {
const query = sql<string>`SELECT table_name
FROM information_schema.tables
WHERE table_schema = 'public'
AND table_type = 'BASE TABLE';
`;
import type { V2_HtmlMetaDescriptor, V2_MetaFunction } from "@remix-run/node";
export const mergeMeta = (
overrideFn: V2_MetaFunction,
appendFn?: V2_MetaFunction,
): V2_MetaFunction => {
return arg => {
// get meta from parent routes
let mergedMeta = arg.matches.reduce((acc, match) => {
return acc.concat(match.meta || []);
@sibelius
sibelius / woovi_job.md
Last active August 31, 2024 16:18
Woovi Job Description
@sibelius
sibelius / woovi_challenge.md
Last active December 24, 2024 16:25
Woovi Challenge
@kapiljhajhria
kapiljhajhria / JEST_VITE_APP.md
Created October 19, 2021 13:25
Integrate Jest & React Testing Library in a React Vite Project.

Integrate Jest & React Testing Library in a React Vite Project

  1. Install Dependencies
yarn add --dev jest babel-jest @babel/preset-env @babel/core @babel/plugin-syntax-jsx @babel/preset-react @testing-library/dom @testing-library/jest-dom @testing-library/react @testing-library/user-event babel-preset-react-app identity-obj-proxy jest-circus jest-scss-transform jest-watch-typeahead
  1. Set Jest & babel configs in package.json
"jest": {
    "roots": [
@rexim
rexim / 0001-Make-it-possible-to-include-files-over-https.patch
Last active September 22, 2024 12:24
TCC patch that enables including files via HTTPS using CURL
From 84c42091cbae3735c52e895221f3f95a87155756 Mon Sep 17 00:00:00 2001
From: rexim <[email protected]>
Date: Wed, 30 Jun 2021 20:43:47 +0700
Subject: [PATCH] Make it possible to include files over https
---
Makefile | 2 +-
tcc.c | 5 +++++
tccpp.c | 43 +++++++++++++++++++++++++++++++++++++++++++
3 files changed, 49 insertions(+), 1 deletion(-)

filter

volume

  • docker ps --filter volume=VOLUME_NAME

list

container doc

  • docker container ls

    • flags: -a: all containers
  • all status exited docker ps --filter "status=exited

@ZulianTiger
ZulianTiger / digitalocean-deployment.txt
Last active March 8, 2025 19:29
How to Deploy a Next.js Website to a DigitalOcean Server
***Simple and stripped down version of this post: https://www.coderrocketfuel.com/article/how-to-deploy-a-next-js-website-to-a-digital-ocean-server ***
1. Create a New Droplet On DigitalOcean
a) In the first section, select the Ubuntu operating system for your server
b) In the "Authentication" section, make sure the "Password" option is selected and enter a strong root password for your server.
2. Access Server Using Root
a) ssh root@server_ip_address (connect to server from terminal)
3. Add user (OPTIONAL)