Skip to content

Instantly share code, notes, and snippets.

@bearlike
bearlike / clear_systemd_journal_logs.md
Created March 8, 2022 07:59
Clear Systemd Journal Logs in Ubuntu 20.04

Clear Systemd Journal Logs in Ubuntu 20.04

Systemd has its own logging system called the journal, and the log files are stored in /var/log/journal.

Check current disk usage of journal files

sudo journalctl --disk-usage

Rotate journal files

  • Active journal files will be marked as archived, so that they are never written to in future.
@aamiaa
aamiaa / CompleteDiscordQuest.md
Last active April 26, 2024 17:40
Complete Recent Discord Quest

Complete Recent Discord Quest

How to use this script:

  1. Accept the quest under User Settings -> Gift Inventory
  2. Join a vc
  3. Stream any window (can be notepad or something)
  4. Press Ctrl+Shift+I to open DevTools
  5. Go to the Console tab
  6. Paste the following code and hit enter:
let wpRequire;
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Jumping Game</title>
<style>
canvas {
border: 1px solid black;
}
import { zodResolver } from "@hookform/resolvers/zod";
import * as z from "zod";
import { Form, FormControl, FormField, FormItem, FormLabel, FormMessage } from '@/components/ui/form'; //shadcn ui folder
const MAX_FILE_SIZE = 1024 * 1024 * 5;
const ACCEPTED_IMAGE_MIME_TYPES = [
"image/jpeg",
"image/jpg",
"image/png",
"image/webp",
];
@n1snt
n1snt / Oh my ZSH with zsh-autosuggestions zsh-syntax-highlighting zsh-fast-syntax-highlighting and zsh-autocomplete.md
Last active April 26, 2024 17:34
Oh my ZSH with zsh-autosuggestions zsh-syntax-highlighting zsh-fast-syntax-highlighting and zsh-autocomplete.md

Oh my zsh.

Oh My Zsh

Install ZSH.

sudo apt install zsh-autosuggestions zsh-syntax-highlighting zsh

Install Oh my ZSH.

@paulirish
paulirish / what-forces-layout.md
Last active April 26, 2024 17:33
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@VictorTaelin
VictorTaelin / gpt4_abbreviations.md
Last active April 26, 2024 17:31
Notes on the GPT-4 abbreviations tweet

Notes on this tweet.

  • The screenshots were taken on different sessions.

  • The entire sessions are included on the screenshots.

  • I lost the original prompts, so I had to reconstruct them, and still managed to reproduce.

  • The "compressed" version is actually longer! Emojis and abbreviations use more tokens than common words.

@bikcrum
bikcrum / Connect Google Colab+Drive with SSH.ipynb
Last active April 26, 2024 17:31
This is the way how can you connect google colab as well as google drive (mounted) using SSH. This is useful when you want to download data directly to your google drive specially for machine learning purpose. It can be easy to mount google drive and use files into for your code.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.