Skip to content

Instantly share code, notes, and snippets.

@evgenyneu
evgenyneu / setup_cursor_ubuntu.md
Last active December 27, 2024 23:54
Install Cursor AI code editor on Ubuntu 24.04 LTS

Install Cursor AI editor on Ubuntu 24.04

  1. Use the Download button on www.cursor.com web site. It will download the NAME.AppImage file.

  2. Copy the .AppImage file to your Applications directory

cd ~/Downloads
mkdir -p ~/Applications
mv NAME.AppImage ~/Applications/cursor.AppImage
@vadimkantorov
vadimkantorov / perlin.py
Last active December 27, 2024 23:48
Perlin noise in PyTorch
# ported from https://github.com/pvigier/perlin-numpy/blob/master/perlin2d.py
import torch
import math
def rand_perlin_2d(shape, res, fade = lambda t: 6*t**5 - 15*t**4 + 10*t**3):
delta = (res[0] / shape[0], res[1] / shape[1])
d = (shape[0] // res[0], shape[1] // res[1])
grid = torch.stack(torch.meshgrid(torch.arange(0, res[0], delta[0]), torch.arange(0, res[1], delta[1])), dim = -1) % 1
@djdembeck
djdembeck / 07-renew-public-att-dhcp.sh
Last active December 27, 2024 23:44
UDMP Allow use of AT&T DHCP IP as static IP and keeps the lease alive
#!/bin/bash
# Polls AT&T's DHCP server for updates, to keep static IPs alive.
# This allows UDM Pro users to set their DHCP IP as 'static' in the 'Internet' section
# allowing the use of static IP configuration in Unifi Network.
# 1. Find your DHCP IP.
# 2. Set Internet IPv4 to Static IP, and enter your DHCP address. Gateway is going to be .1
# 3. Add your static IP block to Additional IP Addresses
# 4. Place this script in the on_boot.d/ directory: https://github.com/unifi-utilities/unifios-utilities/tree/main/on-boot-script
# 5. After reboot, check the script is working: cat /var/log/udhcpc.log
@tykurtz
tykurtz / grokking_to_leetcode.md
Last active December 27, 2024 23:42
Grokking the coding interview equivalent leetcode problems

GROKKING NOTES

I liked the way Grokking the coding interview organized problems into learnable patterns. However, the course is expensive and the majority of the time the problems are copy-pasted from leetcode. As the explanations on leetcode are usually just as good, the course really boils down to being a glorified curated list of leetcode problems.

So below I made a list of leetcode problems that are as close to grokking problems as possible.

Pattern: Sliding Window

sepal.length sepal.width petal.length petal.width variety
5.1 3.5 1.4 .2 Setosa
4.9 3 1.4 .2 Setosa
4.7 3.2 1.3 .2 Setosa
4.6 3.1 1.5 .2 Setosa
5 3.6 1.4 .2 Setosa
5.4 3.9 1.7 .4 Setosa
4.6 3.4 1.4 .3 Setosa
5 3.4 1.5 .2 Setosa
4.4 2.9 1.4 .2 Setosa
@chaitanyagupta
chaitanyagupta / mem-usage.lisp
Last active December 27, 2024 23:38
Memory usage in a Lisp image
;;;; mem-usage.lisp
;;; MEM-USAGE returns memory used by Lisp image in a plist.
;;; MEM-USED prints memory allocated while running the given forms.
;;; Works on SBCL, CMUCL, CCL and CLISP.
;;; Relies on internal APIs (the ones that ROOM uses). Can break at any time.
(defpackage #:mem-usage
(:use #:cl)
(:export #:mem-usage #:mem-used))
@chaitanyagupta
chaitanyagupta / ffmpeg.md
Created July 16, 2021 11:21 — forked from protrolium/ffmpeg.md
ffmpeg guide

ffmpeg

Converting Audio into Different Formats / Sample Rates

Minimal example: transcode from MP3 to WMA:
ffmpeg -i input.mp3 output.wma

You can get the list of supported formats with:
ffmpeg -formats

You can get the list of installed codecs with:

@protrolium
protrolium / ffmpeg.md
Last active December 27, 2024 23:36
ffmpeg guide

ffmpeg

Converting Audio into Different Formats / Sample Rates

Minimal example: transcode from MP3 to WMA:
ffmpeg -i input.mp3 output.wma

You can get the list of supported formats with:
ffmpeg -formats

You can get the list of installed codecs with:

@SolveSoul
SolveSoul / ceshi.ini
Created August 18, 2021 08:56
V380 Pro Activate ONVIF/RTSP
[CONST_PARAM]
rtsp = 1 ; RTSPЭ�飬0���ر� 1������
@Sutil
Sutil / form.tsx
Last active December 27, 2024 23:34
Shandcn UI Money Mask Input - NextJS.
"use client";
import { zodResolver } from "@hookform/resolvers/zod";
import { useForm } from "react-hook-form";
import MoneyInput from "src/components/custom/money-input";
import { Button } from "src/components/ui/button";
import { Form } from "src/components/ui/form";
import * as z from "zod";
const schema = z.object({