Skip to content

Instantly share code, notes, and snippets.

@denguir
denguir / cuda_install.md
Last active February 6, 2024 01:33
Installation procedure for CUDA & cuDNN
View cuda_install.md

How to install CUDA & cuDNN on Ubuntu 22.04

Install NVIDIA drivers

Update & upgrade

sudo apt update && sudo apt upgrade

Remove previous NVIDIA installation

@davidteren
davidteren / nerd_fonts.md
Last active February 6, 2024 01:31
Install Nerd Fonts via Homebrew [updated & fixed]
View nerd_fonts.md
View waifurpg_application.cpp
#pragma once
#include "Application.h"
#include <Renderer2D.h>
class WaifuRPG_Application : public aie::Application
{
public:
WaifuRPG_Application();
virtual ~WaifuRPG_Application();
bool startup() override;
@devster31
devster31 / example.html
Last active February 6, 2024 01:30
Bookmark parser for the NETSCAPE-Bookmark-file-1 format in node. Don't hesitate to comment with feedback.
View example.html
<!DOCTYPE NETSCAPE-Bookmark-file-1>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
<!-- This is an automatically generated file.
It will be read and overwritten.
Do Not Edit! -->
<TITLE>Bookmarks</TITLE>
<H1>Bookmarks</H1>
<DL><p>
<DT><A HREF="https://developer.apple.com/library/mac/releasenotes/InterapplicationCommunication/RN-JavaScriptForAutomation/index.html#//apple_ref/doc/-%20uid/TP40014508" ADD_DATE="1414706885" PRIVATE="0" TAGS="javascript,mac,osx,yosemite">JavaScript for Automation Release Notes</A>
<DD>This article describes JavaScript for Automation, a new feature in OS X Yosemite.
View docker_compose_cheatsheet.md
@SergeyTeplyakov
SergeyTeplyakov / MemberAccessor.cs
Created February 6, 2024 00:25
MemberAccessor
View MemberAccessor.cs
namespace MemberAccessors
{
using System.Collections.Concurrent;
using System.Linq.Expressions;
using System.Reflection;
#nullable enable
/// <summary>
/// A helper class for accessing fields and properties of an object in a performant way.
/// </summary>
public class MemberAccessor<T>
@iandanforth
iandanforth / continuous_cartpole.py
Last active February 6, 2024 01:20
Continuous Cartpole for OpenAI Gym
View continuous_cartpole.py
"""
Classic cart-pole system implemented by Rich Sutton et al.
Copied from http://incompleteideas.net/sutton/book/code/pole.c
permalink: https://perma.cc/C9ZM-652R
Continuous version by Ian Danforth
"""
import math
import gym
@genmon
genmon / streak.py
Last active February 6, 2024 01:20
Calculating a blogging streak -- pseudocode
View streak.py
# A Monday preceding the first post on this blog. Used for calculating week numbers
# (Weeks start on Mondays)
FIRST_MONDAY = date(2000, 2, 14)
# Calculate week_number and streak_weeks for every post, in order. For calculating today's
# streak, we only need to know about the most recent post, but there's a certain amount of
# looking at other posts to figure that out.
# Note: this code looks at *all* posts because I want to calculate all streaks. For just
# today's streak, a quicker algorithm would run in reverse chronological order and stop at
# the first break.