- 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
<?php | |
$client_id = '<insert your spotify app client id>'; | |
$client_secret = '<insert your spotify app client secret>'; | |
$ch = curl_init(); | |
curl_setopt($ch, CURLOPT_URL, 'https://accounts.spotify.com/api/token' ); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1 ); | |
curl_setopt($ch, CURLOPT_POST, 1 ); | |
curl_setopt($ch, CURLOPT_POSTFIELDS, 'grant_type=client_credentials' ); |