Skip to content

Instantly share code, notes, and snippets.

@matthewzring
matthewzring / markdown-text-101.md
Last active May 1, 2024 04:18
A guide to Markdown on Discord.

Markdown Text 101

Want to inject some flavor into your everyday text chat? You're in luck! Discord uses Markdown, a simple plain text formatting system that'll help you make your sentences stand out. Here's how to do it! Just add a few characters before & after your desired text to change your text! I'll show you some examples...

What this guide covers:

@slavistan
slavistan / cuda-ready-archlinux-for-wsl2.md
Last active May 1, 2024 04:17
CUDA-ready Archlinux for WSL2

This is a brief guide on how to install Archlinux as a WSL2 distribution and how to set up CUDA afterwards.

As of late, Window's WSL2 offers GPU passthrough from WSL2/Linux to Windows for NVidia graphics cards which allows to run (and develop) CUDA-based applications on the WSL2/Linux-side with almost native performance. Unfortunately, the official guides for the CUDA setup for WSL2/Linux are predominantly Ubuntu-specific. Here's to you, Arch!

1. Install Archlinux

  1. Make sure that your Windows meets the dependencies and that your WSL2 is set up. See these instructions.

Archlinux is not among the default distributions available for WSL2. We'll install it from a tarball instead, a functionality offered natively by the WSL.

@barnabyalter
barnabyalter / gist:67fc5342794b82e70a04c6fb4284e265
Created May 16, 2019 16:57
Use httpie to test eshelf cors
#!/bin/bash
COOKIE_VALUE='L1NJRXM5eXkxMVhYMnUwNlRtVjd5Q3JWOGVtSjdxY0NneXBuSlNpQmdhb2xZZ2pyR3RCRENFamJSV1E4QXhqZkJpeVlGeTFzQ2UyalQ1RnI5ZHJWWGdvSG5NcFAxK05ramc4MGVKdnhWOEtOSUxaMlJWeGNocHFOWkh1aktmQy9lbHliYllhalhpWUFZYkVpWDkvdTZNdTRvd2JQYmxURnoyVGdUMHdXWVRMU3hVNGdFbWlnQ2U2c2RVbEMvS2FKK2NqTjl6U2ZwU2xtS09wdHlqNGJ2U05URVFaUmNydkxjY0VWNGJpSTd6U1poOWpxaWE1K09TZ01oTkdLYjljTVdLbVd1UWVRSHc1WkhMbjR6cUpCeklnNmNOUXVxS1FyU2xWUmxYbVBWdE09LS1oY1JibHM2RnZ5bStVRm0yYXFuYXBRPT0%3D--1878c3d65e1c28cdd2da459577e8fb9894e2cd7a'
CSRF_TOKEN='yOcFwFaW/ZdCZZj2Co1s8Va2+f6RFx3IYjKiup505yDm1HOi7Cq5IAoi8CaRdOIZEt8akygs1pph6W7M910j+g=='
# http GET localhost:3000/records/from/primo.json per=all _=123456 'Origin:http://localhost:8004'
http GET localhost:3000/records/from/primo.json per=all _=123456 'Origin:http://localhost:8004' \
"Cookie:_eshelf_session=${COOKIE_VALUE}; path=/; HttpOnly" "X-CSRF-Token:${CSRF_TOKEN}"
# http POST localhost:3000/records.json \
# record:='{"external_system":"primo","external_id":"dedupmrg412226627"}' \
@ryanmaclean
ryanmaclean / create-win10-usb-on-mac.sh
Last active May 1, 2024 04:11 — forked from bmatcuk/create-usb.sh
Create a Bootable UEFI Windows USB stick from an ISO on Apple macOS
# Just a quick update for GPT and to use `rsync` instead of `cp`!
# That means this applies to UEFI boot, though for legacy BIOD boot, feel free to swap
# GPT to MBR below.
# Requires https://homebrew.sh to split the install.wim file
brew install wimlib
# First, we need to find our device. BEFORE inserting your USB drive, run the
# following:
diskutil list

HTMX and Bootstrap Toasts

Just a little demo how to use bootstraps toasts component with HTMX and custom triggers. Toasts are stackable and grouped by message (so the same message doesn't pop up several times, when already open.

A Pen by Marcus at Localhost on CodePen.

License.

How to use github as a maven repository

In this how-to it is being explained how to create a maven repository on github and how to use an existing one.

Creating a repository

  1. Clone your original project to a new local repository (change GROUP-NAME and PROJECT-NAME) git clone https://github.com/GROUP-NAME/PROJECT-NAME.git PROJECT-NAME-maven2

  2. Go to the clonned repository (use your PROJECT-NAME-maven2) cd PROJECT-NAME-maven2

@rxaviers
rxaviers / gist:7360908
Last active May 1, 2024 04:02
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@aronbalog
aronbalog / ScrollViewWrapper.swift
Created March 17, 2020 10:57
UIScrollView Wrapper for SwiftUI
import SwiftUI
public struct ScrollViewWrapper<Content: View>: UIViewRepresentable {
@Binding var contentOffset: CGPoint
let content: () -> Content
public init(contentOffset: Binding<CGPoint>, @ViewBuilder _ content: @escaping () -> Content) {
self._contentOffset = contentOffset
self.content = content
}
@vurtun
vurtun / _GJK.md
Last active May 1, 2024 03:59
3D Gilbert–Johnson–Keerthi (GJK) distance algorithm

Gilbert–Johnson–Keerthi (GJK) 3D distance algorithm

The Gilbert–Johnson–Keerthi (GJK) distance algorithm is a method of determining the minimum distance between two convex sets. The algorithm's stability, speed which operates in near-constant time, and small storage footprint make it popular for realtime collision detection.

Unlike many other distance algorithms, it has no requirments on geometry data to be stored in any specific format, but instead relies solely on a support function to iteratively generate closer simplices to the correct answer using the Minkowski sum (CSO) of two convex shapes.