Skip to content

Instantly share code, notes, and snippets.

@Clybius
Clybius / index.html
Last active May 1, 2024 09:04
Embed AV1/No File Size Capped Videos in Discord
<head>
<meta property="og:image" content="GifToEmbedURL"> # Change the content to the link of a gif of your choice, which will be shown as the embed.
<meta property="og:type" content="video.other">
<meta property="og:video:url" content="VideoToEmbedURL"> # Change the content to the link of a video of your choice. Will work with videos over 50 MB, and even unsupported codecs such as AV1!
<meta property="og:video:width" content="1920"> # Set this to the video's width and height, not required, but will show the video as intended if the aspect ratio and size is correct.
<meta property="og:video:height" content="1080">
</head>
@mpusz
mpusz / alternatives.sh
Last active May 1, 2024 09:04
Ubuntu scripts
#/bin/bash
sudo update-alternatives --remove-all gcc
sudo update-alternatives --remove-all g++
sudo update-alternatives --remove-all clang
sudo update-alternatives --remove-all clang++
sudo update-alternatives --remove-all cc
sudo update-alternatives --remove-all c++
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 70 --slave /usr/bin/g++ g++ /usr/bin/g++-7
@hamelsmu
hamelsmu / webhook-circleback.py
Created April 25, 2024 04:59
Generate a project proposal automatically from a meeting transcript
from fastapi import Request, HTTPException
from pydantic import BaseModel, BaseModel, HttpUrl
from modal import Secret, App, web_endpoint, Image
from typing import Optional, List
from example import proposal
import os
app = App(name="circleback", image=Image.debian_slim().pip_install("openai", "pydantic", "fastapi"))
class Attendee(BaseModel):
@yanyongyu
yanyongyu / parser.yaml
Last active May 1, 2024 09:03
Clash For Windows parser for replacing rules
parsers:
- reg: ^.*$
code: >
module.exports.parse = async (raw, { yaml }) => {
const profile = yaml.parse(raw);
const proxies = profile.proxies;
const proxyNames = proxies.map((proxy) => proxy.name);
const proxyGroups = [
{
@RiadHossain43
RiadHossain43 / multi-tenancy.md
Last active May 1, 2024 09:06
MongoDB Multi Tenancy Approach

Stroy

Imagine you are building a simple project management application that has follwing simple features

  • Manage projects (your organisation may have multiple projects running)
  • Manage work packages related to a project
  • Manage members in your organisation that may need to have access to projects in your organisation.

Shared database approach

@Minionguyjpro
Minionguyjpro / Activate_Windows_8_8.1_10_and_11_Pro_for_Free.md
Last active May 1, 2024 09:02
Activate Windows 8, 8.1, 10 and 11 Pro for Free

Activate Windows 8, 8.1, 10 and 11 Pro for Free

A guide how to get and activate Windows 8, 8.1, 10 and 11 Pro for free!

NOTE

If you see the Windows keyboard button in this guide; and you can't find it on your keyboard, you likely have/had Windows 10 which has the button . If you can't find that one, you likely have a PC that has been upgraded to Windows 8/8.1/10/11 from Windows 8.1/8/7/Vista/XP and other ones. If you have one of those, refer the Windows key button to as yours. A list of them is below:

Windows key buttons

- Windows 11

- Windows 10

import torch
import torch._dynamo as torchdynamo
import torch._inductor
import time
import torch._inductor.config as config
from torch._dynamo.utils import cprofile_wrapper
from apex.optimizers import FusedAdam, FusedSGD
config.triton.cudagraphs = True
config.cpp_wrapper = False
@LeviSnoot
LeviSnoot / discord-timestamps.md
Last active May 1, 2024 08:56
Discord Timestamp Syntax

Discord Timestamps

Discord timestamps can be useful for specifying a date/time across multiple users time zones. They work with the Unix Timestamp format and can be posted by regular users as well as bots and applications.

The Epoch Unix Time Stamp Converter is a good way to quickly generate a timestamp. For the examples below I will be using the Time Stamp of 1543392060, which represents November 28th, 2018 at 09:01:00 hours for my local time zone (GMT+0100 Central European Standard Time).

Formatting

Style Input Output (12-hour clock) Output (24-hour clock)
Default <t:1543392060> November 28, 2018 9:01 AM 28 November 2018 09:01