Skip to content

Instantly share code, notes, and snippets.

View jlisee's full-sized avatar

Joseph Lisee jlisee

  • Glydways
  • Falls Church, VA
  • 04:23 (UTC -04:00)
  • LinkedIn in/jlisee
View GitHub Profile
@seddonm1
seddonm1 / gist:5927db05cb7ad38d98a22674fa82a4c6
Last active September 16, 2024 22:13
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 June 17, 2021 21:39
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

FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.


Effective Engineer - Notes

What's an Effective Engineer?