Skip to content

Instantly share code, notes, and snippets.

@muxa
muxa / garage.yaml
Last active May 1, 2024 05:42
ESPHome Garage Switch with State Machine
substitutions:
room: Garage
device_name: Garage Switch
esphome:
name: garage_switch
platform: ESP8266
board: esp01_1m
wifi:
@ntjess
ntjess / git-graph.typ
Last active May 1, 2024 05:41
Generate git graphs in typst
#import "@preview/cetz:0.2.0"
#let d = cetz.draw
#let offset(anchor, x: 0, y: 0) = {
(v => cetz.vector.add(v, (x, y)), anchor)
}
#let default-colors = (red, orange, yellow, green, blue, purple, fuchsia, gray)
#let color-boxed(..args) = {
set text(0.8em)
box(
@tanyuan
tanyuan / archlinux.md
Created April 21, 2016 13:20
Arch Linux 為什麼這麼迷人?

Arch Linux 為什麼這麼迷人?

Arch Linux 是眾多 Linux 作業系統中的一種,對象是有 Linux 指令操作經驗的「進階使用者」,想要打造更適合自己的環境,例如不同的桌面、視窗環境等,體驗最新的套件。

Arch Linux 只有文字介面,不包含圖形介面。也就是說,當你安裝完 Arch Linux 之後,你會看到整個螢幕黑黑一片,電腦期待著你用鍵盤輸入文字指令。Arch Linux 只提供最基本可以讓電腦跑起來的功能,其他套件都要自己安裝。

成為掌握一切的設計師

Arch Linux 不會裝你不會用到的東西,你會自己親自打造完全屬於自己的電腦。不會有程式任意自動啟動,不會有人強迫你更新。你可以把你的電腦改成任何模樣,同樣你也為你的電腦的易用性和安全性負責。

@PurpleVibe32
PurpleVibe32 / vmwk17key.txt
Last active May 1, 2024 05:38
Free VMware Workstation Pro 17 full license keys
Install VMWare Workstation PRO 17 (Read it right. PRO!)
Also, these keys might also work with VMWare Fusion 13 PRO. Just tested it.
Sub to me on youtube pls - PurpleVibe32
if you want more keys - call my bot on telegram. @purector_bot (THE BOT WONT REPLY ANYMORE) - Or: https://cdn.discordapp.com/attachments/1040615179894935645/1074016373228978277/keys.zip - the password in the zip is 102me.
---
This gist can get off at any time.
PLEASE, DONT COPY THIS. IF YOU FORK IT, DONT EDIT IT.
*If you have a problem comment and people will try to help you!
*No virus

How to Install Python 3.8 on Ubuntu and Debian

Tested on Debian 10 Buster

Prerequisites

$ sudo apt-get update
$ sudo apt-get upgrade
$ sudo apt-get install wget  # For downloading file
$ sudo apt-get install xz-utils  # For extracting .tar.xz files

NSLOC stands for 'Normalized Source Code', which is a custom measurement we use (among others) when evaluating the complexity of a codebase.

To get the NSLOC count of a file:

  1. For all functions, reduce any multiline function declarations to a single line.
  2. Remove all comments
  3. Remove all empty lines
  4. Count the remaining lines

Example:

@westphahl
westphahl / optimal_tsp.py
Created June 10, 2010 11:46
TSP brute-force solution
"""
Author: Simon Westphahl <westphahl@gmail.com>
Description: Brute-force implementation for solving the TSP.
http://en.wikipedia.org/wiki/Travelling_salesman_problem
"""
routes = []
def find_paths(node, cities, path, distance):
@akella
akella / setup.md
Last active May 1, 2024 05:33
My Setup
@HarmfulBreeze
HarmfulBreeze / hyperv-esm-fedora.md
Last active May 1, 2024 05:27
Setting up Hyper-V Enhanced Session Mode with Fedora 39

(Lines prefixed with a # should be run as the root user or with sudo. Lines prefixed with a $ should be run as your local user.)

  1. # dnf install xrdp (with Xorg session support: # dnf install xrdp xorgxrdp)
  2. If using Gnome: # $EDITOR /etc/pam.d/xrdp-sesman and comment and uncomment the appropriate lines.
  3. Optionally, rename the shared drives mount: # $EDITOR /etc/xrdp/sesman.ini and set FuseMountName=shared-drives
  4. # $EDITOR /etc/xrdp/xrdp.ini and set port=vsock://-1:3389 ([Globals] section), security_layer=rdp, bitmap_compression=false. Uncomment the whole [Xorg] section if you chose to install the xorgxrdp package.
  5. $ systemctl enable xrdp xrdp-sesman
  6. Shut down the virtual machine (do NOT reboot) and close the Virtual Machine Connection window.
  7. On your host, in PowerShell (as admin or as a user in the "Hyper-V Administrators" group): Set-VM -VMName "Name of your Fedora VM" -EnhancedSessionTransportType HvSocket
  8. Connect to your VM by reopening the Virtual
@MartinEesmaa
MartinEesmaa / youtube_formats.md
Last active May 1, 2024 05:27 — forked from AgentOak/youtube_formats.md
Youtube Format IDs

Note: This is all almost full YouTube ID informations. Original owner goes to AgentOak, modified version by Martin Eesmaa.

See the credits and also special thanks in below.

Last updated: April 2024

Also known as itag or format codes and way back they could be specified with the fmt parameter (e.g. &fmt=22). Depending on the age and/or popularity of the video, not all formats will be available.

DASH video