Skip to content

Instantly share code, notes, and snippets.

View inem's full-sized avatar
🌰
In progress

Ivan Nemytchenko inem

🌰
In progress
View GitHub Profile
@inem
inem / grades
Created October 22, 2021 07:05 — forked from mokevnin/grades
Грейды в компании занимающейся видеостриммингом
L1
Базовые знание диалекта Typescript, основных встроенных примитивов (Array, Object, Function, String, Date) и методов работы с ними, понимание контекста (this) и способов управления им
Базовые знания фреймворка React
Знание наиболее часто используемых Web API: fetch/XHR, Storage, PostMessage, DOM
Умение писать простейшие алгоритмы (поиск, сортировка, сравнение объектов) без требований к их оптимальности.
Навыки кроссбраузерной адаптивной верстки по макету с использованием существующего кода, знание CSS и препроцессора SCSS
Навыки отладки разметки в браузерах Chrome/Safari
Знание принципов работы HTTP, отличий между различными методами, принципов работы Cookies
Практическое владение лучшими практиками структурирования кода: SOLID/DRY/KISS и т.д.
Базовые знания git, понимание git flow
@inem
inem / Simple Form.md
Created January 13, 2020 13:12 — forked from stevenyap/Simple Form.md
Simple Form Cheatsheet

Gemfile

gem 'simple_form'

Installation

rails generate simple_form:install
@inem
inem / clean_code.md
Created January 13, 2020 10:04 — forked from wojteklu/clean_code.md
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

@inem
inem / friendly_urls.markdown
Created June 30, 2018 17:23 — forked from cdmwebs/friendly_urls.markdown
Friendly URLs in Rails

Friendly URLs

By default, Rails applications build URLs based on the primary key -- the id column from the database. Imagine we have a Person model and associated controller. We have a person record for Bob Martin that has id number 6. The URL for his show page would be:

/people/6

But, for aesthetic or SEO purposes, we want Bob's name in the URL. The last segment, the 6 here, is called the "slug". Let's look at a few ways to implement better slugs.

# before (legacy model)
# app/models/user.rb
class User < ActiveRecord::Base
validates :name, length: { maximum: 100 }
validates :lastname, length: { maximum: 100 }
validates :patronymic, length: { maximum: 100 }
before_save :capitalize_name!, :if => :name_process_needed?
private
(1..5).include?(2..3) # => false
require 'active_support/all'
(1..5).include?(2..3) # => true
@inem
inem / get_title_and_url.applescript
Created December 31, 2015 14:57 — forked from vitorgalvao/Get Title and URL.applescript
Applescript to get frontmost tab’s url and title of various browsers.
# Keep in mind that when asking for a `return` after another, only the first one will be output.
# This example is meant as a simple starting point, to show how to get the information in the simplest available way.
# Google Chrome
tell application "Google Chrome" to return URL of active tab of front window
tell application "Google Chrome" to return title of active tab of front window
# Google Chrome Canary
tell application "Google Chrome Canary" to return URL of active tab of front window
tell application "Google Chrome Canary" to return title of active tab of front window
# Chromium
@inem
inem / COMBO17.csv
Last active August 29, 2015 14:20 — forked from syntagmatic/COMBO17.csv
We can't make this file beautiful and searchable because it's too large.
Nr,Rmag,e.Rmag,ApDRmag,mumax,Mcz,e.Mcz,MCzml,chi2red,UjMAG,e.UjMAG,BjMAG,e.BjMAG,VjMAG,e.VjMAG,usMAG,e.usMAG,gsMAG,e.gsMAG,rsMAG,e.rsMAG,UbMAG,e.UbMAG,BbMAG,e.BbMAG,VnMAG,e.VbMAG,S280MAG,e.S280MA,W420FE,e.W420FE,W462FE,e.W462FE,W485FD,e.W485FD,W518FE,e.W518FE,W571FS,e.W571FS,W604FE,e.W604FE,W646FD,e.W646FD,W696FE,e.W696FE,W753FE,e.W753FE,W815FS,e.W815FS,W856FD,e.W856FD,W914FD,e.W914FD,W914FE,e.W914FE,UFS,e.UFS,BFS,e.BFS,VFD,e.VFD,RFS,e.RFS,IFD,e.IFD
6,24.995,0.097,0.935,24.214,0.832,0.036,1.4,0.64,-17.67,0.14,-17.54,0.25,-17.76,0.25,-17.83,0.14,-17.6,0.25,-17.97,0.25,-17.76,0.14,-17.53,0.25,-17.76,0.25,-18.22,0.17,6.60E-04,3.85E-03,1.27E-02,3.72E-03,1.89E-02,4.48E-03,1.82E-02,3.55E-03,1.47E-02,3.01E-03,1.66E-02,4.09E-03,1.88E-02,5.63E-03,2.46E-02,3.51E-03,2.45E-02,5.24E-03,2.16E-02,2.66E-03,2.44E-02,5.46E-03,3.77E-02,6.10E-03,1.17E-02,1.01E-02,1.87E-02,2.39E-03,1.63E-02,1.29E-03,1.73E-02,1.41E-03,1.65E-02,4.34E-04,2.47E-02,4.83E-03
9,25.013,0.181,-0.135,25.303,0.927,0.122,0.864,0.41,-18.28,0.22,17.86,0.55,-18
def authorize_key_for_root(config, *key_paths)
[*key_paths, nil].each do |key_path|
if key_path.nil?
fail "Public key not found at following paths: #{key_paths.join(', ')}"
end
full_key_path = File.expand_path(key_path)
if File.exists?(full_key_path)
config.vm.provision 'file',
@inem
inem / README.md
Last active August 29, 2015 14:18 — forked from syntagmatic/README.md

Null values indicated by space character.