Skip to content

Instantly share code, notes, and snippets.

@bryanltobing
bryanltobing / zod-file-validation.tsx
Last active April 30, 2024 14:57
Zod schema to validate input type file
import { z } from "zod"
const schema = z.object({
file:
typeof window === "undefined" // this is required if your app rendered in server side, otherwise just remove the ternary condition
? z.undefined()
: z
.instanceof(FileList)
.refine(file => file.length !== 0, {
message: "File is required",
@silgon
silgon / 2d_curve_fit.py
Last active April 30, 2024 14:56
Python curve_fit function with 2d data
# curvefit with non linear least squares (curve_fit function)
import numpy as np
from scipy.optimize import curve_fit
def func(x, a, b, c):
return a*np.sin(x[0])+b*np.cos(x[1])+c
limits = [0, 2*np.pi, 0, 2*np.pi] # [x1_min, x1_max, x2_min, x2_max]
side_x = np.linspace(limits[0], limits[1], 100)
side_y = np.linspace(limits[2], limits[3], 100)
@berkorbay
berkorbay / github_desktop_ubuntu.md
Last active April 30, 2024 14:54
To install Github Desktop for Ubuntu

IMPORTANT

See the following links for further updates to Github Desktop for Ubuntu. These are official instructions. (also mentioned by fetwar on Nov 3, 2023)

For the sake of "maintaining the tradition" here is the updated version.

@SuperFlue
SuperFlue / AudioAffinity.xml
Created August 9, 2023 20:38
Scheduled task template for automatically setting core affinity on the audiodg service
<?xml version="1.0" encoding="UTF-16"?>
<Task version="1.2" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
<RegistrationInfo>
<Date>2021-03-13T14:05:56.3414408</Date>
<Author>SuperFlue</Author>
<URI>\AudioAffinity</URI>
</RegistrationInfo>
<Triggers>
<LogonTrigger>
<Enabled>true</Enabled>
@derekstavis
derekstavis / FastList.tsx
Last active April 30, 2024 14:50 — forked from vishnevskiy/FastList.js
Discord's FastList, but in TypeScript
import { forEachObjIndexed } from "ramda";
import * as React from "react";
import {
Animated,
ScrollView,
View,
ViewStyle,
LayoutChangeEvent,
NativeScrollEvent,
} from "react-native";
@PurpleVibe32
PurpleVibe32 / vmwk17key.txt
Last active April 30, 2024 14:49
Free VMware Workstation Pro 17 full license keys
Install VMWare Workstation PRO 17 (Read it right. PRO!)
Also, these keys might also work with VMWare Fusion 13 PRO. Just tested it.
Sub to me on youtube pls - PurpleVibe32
if you want more keys - call my bot on telegram. @purector_bot (THE BOT WONT REPLY ANYMORE) - Or: https://cdn.discordapp.com/attachments/1040615179894935645/1074016373228978277/keys.zip - the password in the zip is 102me.
---
This gist can get off at any time.
PLEASE, DONT COPY THIS. IF YOU FORK IT, DONT EDIT IT.
*If you have a problem comment and people will try to help you!
*No virus
@TrevTV
TrevTV / ArcOn10.md
Last active April 30, 2024 14:48
Guide to installing Arc Browser on Windows 10

As this is not an official way of installing Arc, if you encounter any issues do NOT report them to the developers, they did not intend for people to be running Arc on Windows 10.

This guide is a bit more manual since I wanted to respect the developers' wishes and not directly link any downloads to the beta of Arc.

I don't know how this will work with updates, you may just need to redo the process to update it, but I'm not sure

  1. Install this font: https://aka.ms/SegoeFluentIcons (this fixes the icons since Windows 10 doesn't have this font installed by default)
  2. Download the Arc appinstaller and open it in notepad/some other text editor
  3. Copy everything inside and paste it into this website: https://codebeautify.org/xmlviewer (this is optional, but it makes reading and copying from the file easier)
  4. Find the mainpackage @Uri, it should end in Arc.x64.msix, and open that in a new tab. It should download that msix file.
@choco-bot
choco-bot / FilesSnapshot.xml
Created April 30, 2024 14:46
IsePester v1.0.2 - Failed - Package Tests Results
<?xml version="1.0" encoding="utf-8"?>
<fileSnapshot xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<files>
<file path="C:\ProgramData\chocolatey\lib\IsePester\IsePester.nupkg" checksum="90137BF02B6B4AABEDC6AF1131E73480" />
<file path="C:\ProgramData\chocolatey\lib\IsePester\isepester.nuspec" checksum="6CB8DEF4482DDA19328B31C57B10E0CA" />
<file path="C:\ProgramData\chocolatey\lib\IsePester\tools\ChocolateyInstall.ps1" checksum="25FC7BCE2E7E498C34E9B3C67645214B" />
<file path="C:\ProgramData\chocolatey\lib\IsePester\tools\IsePester.psm1" checksum="258D1C3E196EFD7967E000064852F122" />
<file path="C:\ProgramData\chocolatey\lib\IsePester\tools\README.md" checksum="A726CC12B1551397B3CBDDE0095B44E4" />
</files>
</fileSnapshot>
#!/usr/bin/env bash
# Abort sign off on any error
set -e
# Start the benchmark timer
SECONDS=0
# Repository introspection
OWNER=$(gh repo view --json owner --jq .owner.login)
@LKS90
LKS90 / cheatsheet.md
Last active April 30, 2024 14:45
Cheatsheet for LaTex, using Markdown for markup. I use this with atom.io and markdown-preview-plus to write math stuff

Description

Cheatsheet for LaTex, using Markdown for markup. I use this with atom.io and 📦markdown-preview-plus to write math stuff. 📦keyboard-localization is necessary when using an international layout (like [swiss] german).

Further Reference and source: ftp://ftp.ams.org/pub/tex/doc/amsmath/short-math-guide.pdf

Example expressions / functions