Skip to content

Instantly share code, notes, and snippets.

View Comediant24's full-sized avatar
:shipit:

Iurii Bairamukov Comediant24

:shipit:
View GitHub Profile
@nikushi
nikushi / webpack_dev_server.rb
Last active January 16, 2024 05:10
Rails HMR with rack-proxy and webpack-dev-server, not using Webpacker
# config/initializers/webpack_dev_server.rb
if Rails.development?
Rails.application.config.middleware.use WebpackDevServerProxy, dev_server_host: "localhost:9000"
end
@bibendi
bibendi / .pryrc
Last active December 5, 2023 12:52
Dip on Rails
Pry.config.history.should_save = true
Pry.config.history.file = File.join(__dir__, '.pry_history')
@wojteklu
wojteklu / clean_code.md
Last active November 6, 2025 03:20
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

@Jekins
Jekins / Markdown-docs.md
Last active November 6, 2025 07:30
Руководство по оформлению Markdown файлов

Руководство по оформлению Markdown файлов

Markdown - это облегчённый язык разметки, который преобразует текст в структурированный HTML. Следующее руководство поможет вам разобраться, как использовать Markdown.

Заголовки

# Заголовок первого уровня
## Заголовок второго уровня
### Заголовок третьего уровня
#### Заголовок четвёртого уровня
##### Заголовок пятого уровня
@paulirish
paulirish / what-forces-layout.md
Last active November 5, 2025 12:57
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@averyvery
averyvery / application.rb
Last active May 27, 2024 07:35
Inline CSS or JS in Rails
config.assets.precompile += [
# precompile any CSS or JS file that doesn't start with _
/(^inline[^_\/]|\/[^_])[^\/]*.(js|css)$/,
...
// getCookie(), setCookie(), deleteCookie()
// возвращает cookie если есть или undefined
function getCookie(name) {
var matches = document.cookie.match(new RegExp(
"(?:^|; )" + name.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g, '\\$1') + "=([^;]*)"
))
return matches ? decodeURIComponent(matches[1]) : undefined
@joyrexus
joyrexus / README.md
Last active September 6, 2025 15:46 — forked from liamcurry/gist:2597326
Vanilla JS equivalents of jQuery methods

Sans jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})