Skip to content

Instantly share code, notes, and snippets.

@DavidWhit
DavidWhit / Multiselect
Created August 19, 2024 19:30
Shadcn Multiselect
<script lang="ts">
import * as Select from "@Shadcn/select";
import Badge from "@Shadcn/badge/badge.svelte";
import Button from "@Shadcn/button/button.svelte";
import { faXmark } from "@fortawesome/pro-duotone-svg-icons";
import Icon from "svelte-awesome";
export let value: ValueType[] = [];
export let data: ValueType[] = [];
export let keys: string[] = [];
@DavidWhit
DavidWhit / chunk.txt
Created December 4, 2019 04:14
Chunking algorithm in multiple langs
// chunking loop for languages that have slices of array
// in R
proccessed <- 1
bufferSize <- 4
x <- 1:50
while(proccessed < length(x)) {
slice <- x[proccessed: (proccessed + bufferSize)]
sliceStripNA <- slice[!is.na(slice)]
@DavidWhit
DavidWhit / main.rs
Last active November 20, 2019 19:45
Basic Rust Server
use actix_web::{middleware, web, App, HttpServer, Responder};
fn test() -> impl Responder {
"Hello, world!"
}
fn main() {
std::env::set_var("RUST_LOG", "actix_web=debug");
std::env::set_var("RUST_BACKTRACE", "1");
env_logger::init();
@DavidWhit
DavidWhit / web.config
Last active November 20, 2019 18:45
IIS web.config any EXE
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<location path="." inheritInChildApplications="false">
<system.webServer>
<handlers>
<add name="aspNetCore"
path="*"
verb="*"
modules="AspNetCoreModuleV2"
resourceType="Unspecified" />