Skip to content

Instantly share code, notes, and snippets.

View jlisee's full-sized avatar

Joseph Lisee jlisee

  • Glydways
  • Falls Church, VA
  • 00:22 (UTC -04:00)
  • LinkedIn in/jlisee
View GitHub Profile
@victorb
victorb / AGENTS.md
Last active June 9, 2025 12:39
My current AGENTS.md for use with various LLMs when making them output code

Guidelines to follow at all times:

  • Always keep your changes limited to what explicitly mentioned
  • Don't use any 3rd party libraries/framework/code unless explicitly requested
  • Focus on simplicity both in terms of design/architecture and implementation
  • Code has to be easy to reason about, and easy to extend/change in the future
  • Validate that you understand the question correctly by re-iterating what's asked of you but with different words
  • Double-check your work before committing, think outside the box and consider tradeoffs and pros/cons.
  • Consider how maintainable your changes will be, always try to create as maintainable code as possible
  • Take a step back if needed and retry if you can think of a better solution
@seddonm1
seddonm1 / gist:5927db05cb7ad38d98a22674fa82a4c6
Last active December 16, 2024 10:50
How to build onnxruntime on an aarch64 NVIDIA device (like Jetson Orin AGX)
On an Orin NX 16G the memory was too low to compile and the SWAP file had to be increased.
/etc/systemd/nvzramconfig.sh
change:
```
# Calculate memory to use for zram (1/2 of ram)
totalmem=`LC_ALL=C free | grep -e "^Mem:" | sed -e 's/^Mem: *//' -e 's/ *.*//'`
mem=$((("${totalmem}" / 2 / "${NRDEVICES}") * 1024))
```
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0' name="viewport" />
<link rel="icon" href="data:,">
<title>String art</title>
<script type="text/javascript" src="jquery.min.js"></script>
<style>
html, body {
import collections
import math
import os
import cv2
import numpy as np
import time
MAX_LINES = 4000
N_PINS = 36*8
MIN_LOOP = 20 # To avoid getting stuck in a loop
@holocronweaver
holocronweaver / straight.el
Created September 1, 2018 20:14
Using straight.el with Prelude: place in your .emacs.d/personal/preload folder
;;; straight --- Use straight.el to manage packages with version control.
;;; Commentary:
;; straight.el allows git to track package versions, ensuring Emacs
;; stability and reversible package upgrades.
;;; Author: holocronweaver
;;; Created: 2018
;;; Code:
(let ((bootstrap-file (concat user-emacs-directory "straight/repos/straight.el/bootstrap.el"))
(bootstrap-version 3))
(unless (file-exists-p bootstrap-file)
@Rseding91
Rseding91 / MacroVariant.cpp
Created August 15, 2018 19:39
MacroVariant
#include <MacroVariant.hpp>
bool MacroVariant::isCorrectDataTypeForAction(MacroVariantType action, const std::type_info& type)
{
switch (action)
{
#define ADD_CASE(ACTION, PREFIX, TYPE, VALUE) \
case MacroVariantType::ACTION: return typeid(std::remove_cv<PREFIX TYPE>) == type;
CALL_ON_EVERY_TYPE_WITH_DATA(ADD_CASE)
#undef ADD_CASE
@pesterhazy
pesterhazy / ripgrep-in-emacs.md
Last active July 19, 2024 16:05
Using ripgrep in Emacs using helm-ag (Spacemacs)

Why

Ripgrep is a fast search tool like grep. It's mostly a drop-in replacement for ag, also know as the Silver Searcher.

helm-ag is a fantastic package for Emacs that allows you to display search results in a buffer. You can also jump to locations of matches. Despite the name, helm-ag works with ripgrep (rg) as well as with ag.

How

@s3rvac
s3rvac / visit-variant.cpp
Last active December 7, 2023 05:47
Visiting std::variant using lambda expressions in C++17
// $ g++ -std=c++17 -pedantic -Wall -Wextra visit-variant.cpp -o visit-variant
// $ ./visit-variant
// Implementation:
//
// Based on http://en.cppreference.com/w/cpp/utility/variant/visit
#include <variant>
template<typename... Ts> struct make_overload: Ts... { using Ts::operator()...; };
@kanaka
kanaka / addTwo.wast
Last active March 8, 2025 01:56
Run wast (WebAssembly) in node
(module
(func $addTwo (param i32 i32) (result i32)
(i32.add
(get_local 0)
(get_local 1)))
(export "addTwo" (func $addTwo)))
@floooh
floooh / NetClient.cc
Created January 18, 2017 16:07
NetClient.h (emscripten/osx/win)
//------------------------------------------------------------------------------
// NetClient.cc
//------------------------------------------------------------------------------
#if ORYOL_WINDOWS
#define _WINSOCK_DEPRECATED_NO_WARNINGS (1)
#include <WinSock2.h>
typedef int ssize_t;
#endif
#if ORYOL_POSIX