Skip to content

Instantly share code, notes, and snippets.

@lucacastelnuovo
lucacastelnuovo / README.md
Created October 9, 2024 19:17
Filament V3 - Print Pop-Up

Filament V3 - Print Pop-Up

This code allows you to show a pop-up to print a "PDF" (rendered html) without first having to open the PDF viewer and requiring the user to press the print button.

@sunmeat
sunmeat / different files
Created October 12, 2024 11:34
HQL example
StudentRepo.java:
package com.sunmeat.hibernate;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import java.util.List;
@TheBrainlyProgrammer
TheBrainlyProgrammer / .gitignore
Created October 12, 2024 11:32 — forked from octocat/.gitignore
Some common .gitignore configurations
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
@daveebbelaar
daveebbelaar / llm_factory.py
Created August 17, 2024 13:22
LLM Factory with Instructor
from typing import Any, Dict, List, Type
import instructor
from anthropic import Anthropic
from config.settings import get_settings
from openai import OpenAI
from pydantic import BaseModel, Field
class LLMFactory:
@bradtraversy
bradtraversy / tailwind-webpack-setup.md
Last active October 12, 2024 11:31
Setup Webpack with Tailwind CSS

Webpack & Tailwind CSS Setup

Create your package.json

npm init -y

Create your src folder

Create a folder called src and add an empty index.js file. The code that webpack compiles goes in here including any Javascript modules and the main Tailwind file.

@ayoubzulfiqar
ayoubzulfiqar / folder_structure.md
Created September 5, 2023 06:12
The Folder Structure for Every Golang Project

Go - The Ultimate Folder Structure

Organizing your Go (Golang) project's folder structure can help improve code readability, maintainability, and scalability. While there is no one-size-fits-all structure, here's a common folder structure for a Go project:

project-root/
    ├── cmd/
    │   ├── your-app-name/
    │   │   ├── main.go         # Application entry point
    │   │   └── ...             # Other application-specific files
<div data-video="VIDEO_ID"
data-autoplay="0"
data-loop="1"
id="youtube-audio">
</div>
<script src="https://www.youtube.com/iframe_api"></script>
<script src="https://cdn.rawgit.com/labnol/files/master/yt.js"></script>
@EgorBron
EgorBron / discord-revive.md
Last active October 12, 2024 11:27
Восстанавливаем доступ к ДС с помощью Amnezia WG

Оживляем ДС

Быстрый способ (на ~10 минут) для разблокировки Discord вместе с голосовыми каналами. Этот способ также разблокирует YouTube и X/Twitter, а также любые другие заблокированные сайты.

Спасибо ImMAILWARE за скрипт для генерации конфигов.

Я рекомендую сразу перейти к способу с браузером, так как его относительно проще провернуть.

Способ с Linux

@bradtraversy
bradtraversy / mysql_cheat_sheet.md
Last active October 12, 2024 11:26
MySQL Cheat Sheet

MySQL Cheat Sheet

Help with SQL commands to interact with a MySQL database

MySQL Locations

  • Mac /usr/local/mysql/bin
  • Windows /Program Files/MySQL/MySQL version/bin
  • Xampp /xampp/mysql/bin

Add mysql to your PATH

@bitsurgeon
bitsurgeon / nvidia.md
Last active October 12, 2024 11:24
install Nvidia driver on Ubuntu with Secure Boot

Install Nvidia Driver on Ubuntu 18.04.3

Secure Boot

This section applies to machines with Secure Boot, such as ThinkPad.

  1. Before installation, switch to "Discrete Graphics" in BIOS, if both Intel and Nvidia graphics are present.
  2. During installation, make sure to select the "Install third-party software for graphics and Wi-Fi hardware and addition media formats" in "Updates and other software" screen.
  3. Select "Configure Secure Boot", and set password.
  4. Continue Ubuntu installation as normal.