Skip to content

Instantly share code, notes, and snippets.

@sdwvit
sdwvit / quizzes.md
Last active May 1, 2024 05:46
Canadian citizenship practice questions

Citizenship test practice questions and quizzes

Quiz 1-1

1. Which of the following statement is true?

  • Canada is a Republic
  • Immigrants between the ages of 21 and 54 must learn about voting laws in order to become Canadian citizens
  • Canadians haven't given up anything to protect their way of life
  • Canada has welcomed immigrants for years in order to create a society that is free, just, and affluent
@Fuwn
Fuwn / xp.md
Last active May 1, 2024 05:46
Windows XP All Editions Universal Product Keys Collection.

Although Microsoft does not support Windows XP updates any more, I’m sure there are still many users using it due to their personal habits or job demands. Therefore XP’s product keys may be necessary even now, and Fuwn provided you with the most comprehensive Windows XP product keys here, just in order to provide some convenience.

The following CD-KEYs are official and original from Microsoft, mainly used for Windows XP Professional Service Pack 2/3 VOL/VLK system images which are the easiest ones to find on the Internet. Their biggest advantage is your Windows XP will be activated after using these CD-KEYs to complete installation.

// Windows XP Pro Product Keys //

@kashifulhaque
kashifulhaque / NvChad.md
Last active May 1, 2024 05:45
Neovim stuff with NvChad

Neovim keybinds

  • Capital letters do the opposite of small letters in command (Press shift to trigger capital letters)
  • _ (underscore) to move the cursor at the beginning of line (doesn't switch to insert mode)
    • 0 (zero) moves the cursor to the zeroth position of the line (doesn't switch to insert mode)
  • $ (dollar) to move the cursor at the end of line (doesn't switch to insert mode)
  • d$ will delete from wherever your cursor is till the end of the line
  • f<character> to move cursor to the first occurrence of <character>
    • f( to move cursor to first occurence of (
  • t<character> to move cursor to upto but not on the first occurrence of <character>
  • t( to move cursor to first occurence of (
@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):