Skip to content

Instantly share code, notes, and snippets.

View maksimr's full-sized avatar
🎯
Focusing

Maksim Ryzhikov maksimr

🎯
Focusing
View GitHub Profile

Введение

Начать стоит отсюда. Не пугайтесь то, что это книга по незнакомой OS, эти термины практически везде одинаковые и здесь они изложены в понятной для начинающих форме.

http://www.qnx.com/developers/docs/6.4.1/neutrino/getting_started/s1_procs.html

Прочесть нужно треть главы до подраздела "Starting a process", если С не пугает, читайте полностью. После прочтения вы будете понимать, что такое process, thread, mutex, priorites, semaphores, scheduler, contex-switch, kernel states.

Ruby

@maksimr
maksimr / karma.conf.js
Created December 11, 2016 21:22
Karma jasmine random order seed reporter
module.exports = function(config) {
config.set({
plugins: [
'karma-*', {
'reporter:inline-jasmine-seed': ['type', function(baseReporterDecorator) {
baseReporterDecorator(this);
this.renderBrowser =
this.onBrowserError =
this.onBrowserLog =
@maksimr
maksimr / what-forces-layout.md
Created May 23, 2017 14:08 — forked from paulirish/what-forces-layout.md
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.

Element

Box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
  • elem.clientLeft, elem.clientTop, elem.clientWidth, elem.clientHeight
  • elem.getClientRects(), elem.getBoundingClientRect()

Техники которые позволяют контролировать сложность системы

  • Абстракция "Черный Ящик" (black-box abstraction) - Скрытие деталей реализации
  • Создание стандартных интерфейсов (conventional interfaces) - Возможность поддерживать разные типы данных
  • Создание новых языков (Metalinguistic abstraction) - Скрывать детали на уровне языка

Структура языка

  • Примитивные элементы - из чего состоит язык
  • Способы соединения примитивных элементов(комбинирование) - для получения более сложных вещей
@maksimr
maksimr / index.js
Last active July 2, 2020 11:41
Programmatically updat imports inside javascript code
/**
* Example of how to programmatically update imports inside javascript code
* when you move files
*/
function main() {
const assert = require('assert');
const filePath = '/a/b/c.js';
const fromPath = '../foo/foo.js';
const toPath = '../foo/bar.js';
@maksimr
maksimr / jasmine.toMatchImageSnapshot.js
Created November 20, 2020 19:10
Adopt jest-image-snapshot for jasmine
jasmine.getEnv().addReporter(new class {
specStarted(spec) {
jasmine.getEnv().currentSpec = spec;
}
specDone() {
jasmine.getEnv().currentSpec = null;
}
}());
beforeAll(() => {
<link rel="shortcut icon" width=32px>
<canvas style="display: none" id="loader" width="16" height="16"></canvas>
<script>
class Loader {
constructor(link, canvas) {
this.link = link;
this.canvas = canvas;
this.context = canvas.getContext('2d');
this.context.lineWidth = 2;
@maksimr
maksimr / dynamic-reps-repl.clj
Created April 7, 2022 14:56
Dynamic add Clojure dependency without REPL restart
(comment {
org.clojure/tools.deps.alpha {:git/url "https://github.com/clojure/tools.deps.alpha.git" :sha "d492e97259c013ba401c5238842cd3445839d020"}
})
(comment
(require '[clojure.tools.deps.alpha.repl :refer [add-lib]])
(add-lib 'ring/ring-jetty-adapter {:mvn/version "1.9.5"}))
@maksimr
maksimr / babashka.vim
Last active May 13, 2022 09:46
Vim Embed clojure language into sh for babashka (bb) command
" Clojure Embedding:
" ==============
if exists("b:current_syntax")
unlet b:current_syntax
endif
syn include @CLJScript syntax/clojure.vim
syn region CLJScriptCode matchgroup=CLJCommand start=+[=\\]\@<!'+ skip=+\\'+ end=+'+ contains=@CLJScript contained
syn region CLJScriptEmbedded matchgroup=CLJCommand start=+\<bb\>+ skip=+\\$+ end=+[=\\]\@<!'+me=e-1 contains=@shIdList,@shExprList2 nextgroup=CLJScriptCode
syn cluster shCommandSubList add=CLJScriptEmbedded
hi def link CLJCommand Type
@maksimr
maksimr / launch.json
Created April 14, 2023 08:59
VS Code configuration for C++ 👨🏻‍💻
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "clang++ - Build and debug active file",
"type": "lldb",
"request": "launch",