Skip to content

Instantly share code, notes, and snippets.

@wojteklu
wojteklu / clean_code.md
Last active May 11, 2024 15:27
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

@bzvyagintsev
bzvyagintsev / README.md
Last active May 11, 2024 15:26
Шаблон README.md

Название проекта

Добавьте краткое описание проекта, опишите какую задачу он решает. 1-3 предложения будет достаточно. Добавьте бейджи для важных статусов проекта: статус разработки (в разработке, на поддержке и т.д.), статус билда, процент покрытия тестами и тд.

Содержание

@WebRTCGame
WebRTCGame / JavascriptBooks.md
Last active May 11, 2024 15:24
Free Javascript Books

Useful Links

23 Free JavaScript Books

A curated collection of awesome & free JavaScript books to help you learn the JavaScript programming language.

If you know of any other free JavaScript books that you think should be on this list, please let me know in the comments section and I will get them added.

@Tomalak
Tomalak / isNodeList.js
Last active May 11, 2024 15:22
A function to test if a JavaScript object is a DOM NodeList. This is designed to work across all browser implementations. StackOverflow question reference http://stackoverflow.com/a/7238344/18771.
/* Released under the MIT License in 2014. http://opensource.org/licenses/mit-license */
function isNodeList(nodes) {
var stringRepr = Object.prototype.toString.call(nodes);
return typeof nodes === 'object' &&
/^\[object (HTMLCollection|NodeList|Object)\]$/.test(stringRepr) &&
nodes.hasOwnProperty('length') &&
(nodes.length === 0 || (typeof nodes[0] === "object" && nodes[0].nodeType > 0));
}
@julianshapiro
julianshapiro / IE.js
Last active May 11, 2024 15:22
Future-Proof IE Version Detection Without User Agent Sniffing
var IE = (function() {
if (document.documentMode) {
return document.documentMode;
} else {
for (var i = 7; i > 4; i--) {
var div = document.createElement("div");
div.innerHTML = "<!--[if IE " + i + "]><span></span><![endif]-->";
if (div.getElementsByTagName("span").length) {
@julianshapiro
julianshapiro / RAF.js
Last active May 11, 2024 15:21
requestAnimationFrame Polyfill
var requestAnimationFrame = window.requestAnimationFrame || (function() {
var timeLast = 0;
return window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || function(callback) {
var timeCurrent = (new Date()).getTime(),
timeDelta;
/* Dynamically set the delay on a per-tick basis to more closely match 60fps. */
/* Technique by Erik Moller. MIT license: https://gist.github.com/paulirish/1579671. */
timeDelta = Math.max(0, 16 - (timeCurrent - timeLast));
@heroheman
heroheman / ranger-cheatsheet.md
Last active May 11, 2024 15:18
Ranger Cheatsheet

Ranger Cheatsheet

General

Shortcut Description
ranger Start Ranger
Q Quit Ranger
R Reload current directory
? Ranger Manpages / Shortcuts
@gustavomdsantos
gustavomdsantos / AutoHotKey script - Always-on-top.ahk
Last active May 11, 2024 15:18
AutoHotKey script that make any window Always-on-Top on Windows.
; Press Ctrl+Shift+Space to set any currently active window to be always on top.
; Press Ctrl+Shift+Space again set the window to no longer be always on top.
; Source: https://www.howtogeek.com/196958/the-3-best-ways-to-make-a-window-always-on-top-on-windows
^+SPACE::
WinGetTitle, activeWindow, A
if IsWindowAlwaysOnTop(activeWindow) {
notificationMessage := "The window """ . activeWindow . """ is now always on top."
notificationIcon := 16 + 1 ; No notification sound (16) + Info icon (1)
}
@Zsailer
Zsailer / schemaorg-pydantic.ipynb
Last active May 11, 2024 15:17
Define and validate schema.org structured data in Python with Pydantic
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kwmiebach
kwmiebach / pytest.md
Last active May 11, 2024 15:17 — forked from amatellanes/pytest.sh
pytest cheat sheet

Usage

(Create a symlink pytest for py.test)

pytest [options] [file_or_dir] [file_or_dir] ...

Help: