Skip to content

Instantly share code, notes, and snippets.

Flet Code Highlighting

image

import flet as ft
import re
from dataclasses import dataclass
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active May 17, 2024 18:52
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@Peej11
Peej11 / sc_on_deck.md
Last active May 17, 2024 18:48
Star Citizen 3.18.1 on the Steam Deck

This is a set of instructions specific to the Steam Deck that is curated and combined from several guides and help I've found on the LUG Discord as well as /r/StarCitizen. This will help you configure your system, download and extract the utilities needed, and do a (mostly) standard install. We're not using Lutris and instead doing a manual install since the LUG installer doesn't work well with the Flatpak without additional configuration. Hopefully it is helpful.

Tested on the 512GB SKU

Prep your Steam Deck

Enable SSH (optional)

Enable SSH if you'd like to do things remotely. This is helpful if you don't have a mouse and keyboard.

  1. Switch to desktop mode
  2. Open Konsole
  3. Set a password with passwd
@billchurch
billchurch / sonos_unifi_discovery.py
Last active May 17, 2024 18:48
Python script to find all sonos units on your network with uPNP and then connect to a unifi switch to tell you what switch port they're on
import socket
import requests
import paramiko
import time
import xml.etree.ElementTree as ET
def discover_sonos_devices():
MCAST_GRP = '239.255.255.250'
MCAST_PORT = 1900
msg = (
@adalcinojunior
adalcinojunior / gitflow-breakdown.md
Created November 25, 2020 20:23 — forked from JamesMGreene/gitflow-breakdown.md
A comparison of using `git flow` commands versus raw `git` commands.

Initialize

gitflow git
git flow init git init
  git commit --allow-empty -m "Initial commit"
  git checkout -b develop master

Connect to the remote repository

@pwxcoo
pwxcoo / huffman.cpp
Created July 14, 2019 13:56
huffman encoding implemented by c++
#include <iostream>
#include <string>
#include <queue>
#include <unordered_map>
using namespace std;
// A Tree node
struct Node
{
char ch;
@JacobFV
JacobFV / dont_raise_until_done.py
Created May 17, 2024 18:44
Collect all the errors in a block of code before raising
import traceback
class DontRaiseUntilDone:
def __init__(self):
self.exceptions = []
def __enter__(self):
return self
def __exit__(self, exc_type, exc_val, exc_tb):
@wojteklu
wojteklu / clean_code.md
Last active May 17, 2024 18:42
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules