Skip to content

Instantly share code, notes, and snippets.

/* Merge sort in C */
#include<stdio.h>
#include<stdlib.h>
// Function to Merge Arrays L and R into A.
// lefCount = number of elements in L
// rightCount = number of elements in R.
void Merge(int *A,int *L,int leftCount,int *R,int rightCount) {
int i,j,k;
@luxplanjay
luxplanjay / flex-basis-calc.css
Last active May 11, 2024 15:56
Формула расчёта ширины flex-элемента в сетке
.element {
flex-basis: calc((100% - кол-во маржинов в строке * значение маржина) / кол-во элементов в строке);
}
@FlandreDaisuki
FlandreDaisuki / slido-mark-as-read.user.js
Created May 11, 2024 15:43
安裝 Tampermonkey 後,點 Raw 下載→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→↘
// ==UserScript==
// @name slido mark as read
// @namespace https://flandre.tw
// @version 0.0.1
// @description Add "mark as read" function to slido question
// @author FlandreDaisuki
// @match https://app.sli.do/event/*
// @require https://unpkg.com/winkblue@0.0.5/dist/winkblue.umd.js
// @icon https://www.google.com/s2/favicons?sz=64&domain=sli.do
// @grant none
@hakerdefo
hakerdefo / sources.list
Created June 11, 2023 18:47
Debian 12 "bookworm" complete sources.list
deb https://ftp.debian.org/debian/ bookworm contrib main non-free non-free-firmware
# deb-src https://ftp.debian.org/debian/ bookworm contrib main non-free non-free-firmware
deb https://ftp.debian.org/debian/ bookworm-updates contrib main non-free non-free-firmware
# deb-src https://ftp.debian.org/debian/ bookworm-updates contrib main non-free non-free-firmware
deb https://ftp.debian.org/debian/ bookworm-proposed-updates contrib main non-free non-free-firmware
# deb-src https://ftp.debian.org/debian/ bookworm-proposed-updates contrib main non-free non-free-firmware
deb https://ftp.debian.org/debian/ bookworm-backports contrib main non-free non-free-firmware
#!/usr/bin/env bash
# Abort sign off on any error
set -e
# Start the benchmark timer
SECONDS=0
# Repository introspection
OWNER=$(gh repo view --json owner --jq .owner.login)
@wojteklu
wojteklu / clean_code.md
Last active May 11, 2024 15:47
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

@reinvanoyen
reinvanoyen / terminal-prompt-git-branch-zsh.md
Last active May 11, 2024 15:42
Add Git Branch Name to Terminal Prompt (MacOS zsh)

Add Git Branch Name to Terminal Prompt (zsh)

Updated for MacOS with zsh

  • Catalina
  • Big Sur
  • Monterey
  • Ventura
  • Sonoma

screenshot

@stellasphere
stellasphere / descriptions.json
Last active May 11, 2024 15:40
WMO weather interpretation code descriptions (& images)
{
"0":{
"day":{
"description":"Sunny",
"image":"http://openweathermap.org/img/wn/01d@2x.png"
},
"night":{
"description":"Clear",
"image":"http://openweathermap.org/img/wn/01n@2x.png"
}