- Docker running
- nvidia-smi running
Print out the GPUs available in docker:
docker run -it --rm --gpus all ubuntu nvidia-smi -L
import React, { ReactNode, useState } from "react"; | |
type Experiment = { | |
exposure: number; | |
render: ({ success }: { success: any }) => any; | |
name?: string; | |
}; | |
enum TestEvent { | |
"VIEW" = "View", |
export const decimalStringToCento = (decimalString: string): number => { | |
// Replace comma with dot to make it a valid float | |
const cleanedString = decimalString.replace(",", "."); | |
// Parse the string as a floating-point number | |
const floatValue = parseFloat(cleanedString); | |
// Multiply by 100 to get the cento number | |
const centoNumber = Math.round(floatValue * 100); |
const parseCSVLine = (line: string): string[] => { | |
const parts = line.split(","); | |
const result: string[] = []; | |
parts.reduce( | |
(accumulator, currentPart) => { | |
if (!accumulator.insideQuotes) { | |
if (currentPart.startsWith('"') && currentPart.endsWith('"')) { | |
// Handle the case when the value is enclosed in double quotes | |
result.push(currentPart.slice(1, -1)); |
/* | |
HOW TO USE: | |
import React from "react"; | |
import useScrollableMask from "./useScrollableMask"; | |
const Example = () => { | |
const { scrollDiv, scrollDivStyles } = useScrollableMask(); | |
return ( |
import { useState, useEffect } from "react"; | |
export const useAudioContext = () => { | |
const [audioContext, setAudioContext] = useState(null); | |
const [currentSourceNode, setCurrentSourceNode] = useState(null); | |
const [gainNode, setGainNode] = useState(null); | |
useEffect(() => { | |
const context = new AudioContext(); | |
setAudioContext(context); |
"use client"; | |
import { useForm } from "react-hook-form"; | |
import { useEffect } from "react"; | |
const AdvancedForm = () => { | |
const { register, handleSubmit, setValue, watch } = useForm(); | |
const watchedValues = watch(); | |
// Function to update the query string | |
const updateQueryString = () => { |
Previously I've been using GifCam, but it doesn't play well with my retina display, so I had to come up with something. There's strong options for Mac but no good free options for Windows.
I can use the native Windows snipping tool to record my screen, but I'm unable to save the recording as a gif, resulting in pretty big MP4 files. I don't want that. So I created this little script that can convert the recorded MP4 file to GIF for a great reduction in file size.
dad => dads-email@gmail.com
/* | |
Sådan gemmer du dine ønskelister fra AddWish.com til CSV | |
-------------------------------------------------------- | |
1) Log ind på din ønskeliste på www.addwish.com | |
2) Start console i din browser (fx. tryk [ctrl+shift+i] i Chrome) | |
3) Copy/paste dette script ind i console og tryk [enter] for at køre det | |
4) Kopier CSV-teksten som vises i din browser prompt ind i Google sheets og tryk "Split text to columns" og vælg "Semicolon" | |
5) Din ønskeliste er nu gemt i Sheets |