Skip to content

Instantly share code, notes, and snippets.

@wojteklu
wojteklu / clean_code.md
Last active May 8, 2024 08:00
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

@ed-cooper
ed-cooper / json-lang.tex
Created February 20, 2018 14:25
Latex lstlisting json language style
\definecolor{delim}{RGB}{20,105,176}
\definecolor{numb}{RGB}{106, 109, 32}
\definecolor{string}{rgb}{0.64,0.08,0.08}
\lstdefinelanguage{json}{
numbers=left,
numberstyle=\small,
frame=single,
rulecolor=\color{black},
showspaces=false,
@preinpost
preinpost / home_screen.dart
Created March 3, 2023 15:49
headers override
// ์—๋Ÿฌ์˜ ์›์ธ
// ๋”ฐ๋กœ User-Agent ๊ฐ’์„ ์ถ”๊ฐ€ํ•˜์ง€ ์•Š์œผ๋ฉด ๊ธฐ๋ณธ๊ฐ’์œผ๋กœ `Dart/<version> (dart:io)` ๊ฐ€ ๋“ค์–ด๊ฐ‘๋‹ˆ๋‹ค.
// (https://api.flutter.dev/flutter/dart-io/HttpClient/userAgent.html)
// ์ด ๊ฐ’์„ ์ง€์šฐ๊ณ  ๋ธŒ๋ผ์šฐ์ €์—์„œ ์‚ฌ์šฉํ•˜๋Š” ๊ฐ’์œผ๋กœ ๋ฐ”๊ฟ”์ค๋‹ˆ๋‹ค.
// (๋ธŒ๋ผ์šฐ์ € ๊ฐ’์ด ์•„๋‹ˆ๋ฉด ๋„ค์ด๋ฒ„์—์„œ ์ฐจ๋‹จํ•˜๋Š”๊ฑธ๋กœ ๋ณด์ž…๋‹ˆ๋‹ค)
// ๋ฐฉ๋ฒ• 1. (local? override)
// [home_screen.dart]
@uid-root
uid-root / ftpserver.py
Last active May 8, 2024 07:59 — forked from scturtle/ftpserver.py
simple ftp server in python
#!/usr/bin/env python2
# coding: utf-8
import os,socket,threading,time
#import traceback
allow_delete = False
#local_ip = socket.gethostbyname(socket.gethostname())
local_ip = ('192.168.1.146')
local_port = 21
@valorad
valorad / InstallingXRDP.md
Created June 5, 2022 13:18
Installing xrdp

Ubuntu:

sudo apt install xrdp 
sudo adduser xrdp ssl-cert 
sudo systemctl restart xrdp

Fedora:

@khalidx
khalidx / node-typescript-esm.md
Last active May 8, 2024 07:58
A Node + TypeScript + ts-node + ESM experience that works.

The experience of using Node.JS with TypeScript, ts-node, and ESM is horrible.

There are countless guides of how to integrate them, but none of them seem to work.

Here's what worked for me.

Just add the following files and run npm run dev. You'll be good to go!

package.json

@mojaray2k
mojaray2k / unique-array-values-js.md
Created May 28, 2020 15:48
3 Ways to get unique values from an array in Javascript

Here are 3 ways to retrieve unique values from arrays in Javascript

  1. The array.filter method which is a higher order function which means it takes a function as it's argument.
const someArray = ['๐Ÿ˜', '๐Ÿ’€', '๐Ÿ’€', '๐Ÿ’ฉ', '๐Ÿ’™', '๐Ÿ˜', '๐Ÿ’™'];

const getUniqueValues = (array) => (
  array.filter((currentValue, index, arr) => (
		arr.indexOf(currentValue) === index
@paulloz
paulloz / GodotSink.cs
Last active May 8, 2024 07:56
Godot Serilog Sink
using Godot;
using Serilog;
using Serilog.Configuration;
using Serilog.Core;
using Serilog.Events;
using Serilog.Formatting;
using Serilog.Formatting.Display;
using Serilog.Parsing;
using System;
using System.Globalization;
@tbaddade
tbaddade / a11y-list.md
Last active May 8, 2024 07:55
Sammlung fรผr Barrierefreiheit
@samiraguiar
samiraguiar / MC Cheat Sheet
Last active May 8, 2024 07:55 — forked from maciakl/MC Cheat Sheet
Midnight Commander Cheat Sheet / Shortcuts
Note for newcomers:
In the shortcuts below, "C" stands for CTRL and "A" stands for "ALT". This is a convention
used in the Midnight Commander documentation and was kept here.
You can also use "ESC" instead of "ALT", which is useful on Macbooks.
Main View
---------------------------------------------------------------
- File/directory operations