Skip to content

Instantly share code, notes, and snippets.

@extremecoders-re
extremecoders-re / qemu-networking.md
Last active May 4, 2024 05:55
Setting up Qemu with a tap interface

Setting up Qemu with a tap interface

There are two parts to networking within QEMU:

  • The virtual network device that is provided to the guest (e.g. a PCI network card).
  • The network backend that interacts with the emulated NIC (e.g. puts packets onto the host's network).

Example: User mode network

@mantasu
mantasu / install-cuda-tf-pytorch.md
Last active May 4, 2024 05:54
Tensorflow & Pytorch installation with CUDA (Linux and WSL2 for Windows 11)

Install Tensorflow & Pytorch with CUDA [Linux | WSL2]

Overview

This guide provides steps on how to install Tensorflow and Pytorch on Linux environment (including WSL2 - Windows Subsystem for Linux) with NVIDIA GPU support. Here I focus on Ubuntu 22.04 and WSL2 (Windows 11) but things should work on more/less recent/relevant versions. From what I've checked there are no full consistent guidelines, hopefully this one should clear things up (also serve as a reminder for me).

To install purely on Windows 10/11 (no WSL), I suggest to follow this tutorial.

GPU Setup

const apiEndpoint = "https://api.spotify.com/v1";
const authEndpoint = "https://accounts.spotify.com/api/token";
const clientId = "your client id";
const clientSecret = "your client secret";
const method = "album";
const queryParams = `?q=${encodeURIComponent(
"Pink Floyd - The wall" // query here
)}&type=${method}&limit=1`;
const searchUrl = `${apiEndpoint}/search${queryParams}`;
@Dog
Dog / gist:272225a5b22a393d2088
Last active May 4, 2024 05:48
Converting between Javascript date and Python datetime with bson
from bson.tz_util import utc
from datetime import datetime, timedelta
# This file is to impliment date related helper functions
#
# This is mainly needed because bson uses the javascript date class.
# The javascript Date() class represents timestamps in milliseconds.
# For some documentation on how Bson, Json, and Date work together, refer to:
# http://blog.mongohq.com/from-json-to-bson-and-back/
#
@ardakazanci
ardakazanci / Bar.kt
Created April 24, 2024 15:49
Bar with JetpackCompose
data class BarDataM(val value: Float, val label: String)
@Composable
fun BarChartComponent(
bars: List<BarDataM>,
barWidth: Dp,
spaceBetweenBars: Dp,
animateChart: Boolean
) {
var selectedBar by remember { mutableIntStateOf(-1) }
@dkasak
dkasak / xdg.vim
Last active May 4, 2024 05:45 — forked from kaleb/XDG.vim
vim XDG Base Directory support
" XDG Environment For VIM
" =======================
"
" References
" ----------
"
" - http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html#variables
" - http://tlvince.com/vim-respect-xdg
" - https://gist.github.com/kaleb/3885679 (the original version)
"
@antonfrancisjeejo
antonfrancisjeejo / index.css
Created February 5, 2024 17:27
For three.js portfolio
@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@100;200;300;400;500;600;700;800;900&family=Work+Sans:wght@100;200;300;400;500;600;700;800;900&display=swap");
@tailwind base;
@tailwind components;
@tailwind utilities;
:root {
--blue-rgb: 237 245 255;
--green-rgb: 125 161 35;
}
@russellsamora
russellsamora / us_county_latlng.csv
Last active May 4, 2024 05:42
US counties with fips code, name, and lat lng
fips_code name lng lat
01059 Franklin -87.843283 34.44238135
13111 Fannin -84.31929617 34.86412558
19109 Kossuth -94.20689787 43.20413984
40115 Ottawa -94.81058917 36.83587796
42115 Susquehanna -75.80090451 41.82127676
40053 Grant -97.78493404 36.79651364
31029 Chase -101.6979407 40.52371008
29213 Taney -93.04127586 36.65473646
32510 Carson City -119.7473502 39.15108405
@nyancodeid
nyancodeid / README.md
Last active May 4, 2024 05:41
Make RESTful API with Google Apps Script and SpreadSheet

Google Script CRUD

By Ryan Aunur Rassyid

Simply create RESTful API with Google Script and store it to Google SpreadSheet like a Pro.

@veekaybee
veekaybee / normcore-llm.md
Last active May 4, 2024 05:37
Normcore LLM Reads

Anti-hype LLM reading list

Goals: Add links that are reasonable and good explanations of how stuff works. No hype and no vendor content if possible. Practical first-hand accounts of models in prod eagerly sought.

Foundational Concepts

Screenshot 2023-12-18 at 10 40 27 PM

Pre-Transformer Models