Skip to content

Instantly share code, notes, and snippets.

View nmurzin's full-sized avatar
🖥️
Hello world

Nikita Murzin nmurzin

🖥️
Hello world
View GitHub Profile
@roman01la
roman01la / doc.md
Last active October 30, 2017 02:40
What it takes to build ClojureScript web app

What it takes to build ClojureScript web app

ClojureScript-only codebase

  1. Install Java
  2. Install Leiningen
  3. lein new figwheel my-app
  4. lein cljsbuild once min
  5. DONE

With JavaScript dependencies

<?php
interface Logger
{
public function log(string $message, int $level = 0): void;
}
@xgrommx
xgrommx / ranges.js
Last active June 13, 2020 23:04
Generate ranges in javascript
const range1 = len => Object.keys(new Int8Array(len)).map(parseFloat);
const range2 = len => Array.apply(null, {length: len}).map(Number.call, Number);
const range3 = (start, end) => Array.apply(null, Array(end - start)).map((_, i) => start + i);
const range4 = (start, end) => [...Array(end - start)].map((_, i) => start + i);
const range5 = len => Object.keys(Array.apply(null, Array(len)));
@fesor
fesor / README.md
Last active March 12, 2024 00:02
Доступ к данным или как мы учились не замечать базу данных

Оргенизация слоя хранения данных это всегда не простая задача, с кучей кейсов, вроде блокировки перезаписи, транзакции, сохранение целостности данных. В какой-то момент появились СУБД и обещали решить эти проблемы, но с ними появились новые - как нам работать с состоянием, которое мы храним?

Существует 4 основных подхода для организации рабоыт с базой данных, Table Gateway, Row Data Gateway, Active Record и Data Mapper. Все эти подходы объеденяет то, что они скрывают от нас базу данных и нюансы работы с ними (в частности SQL). На сегодняшний день самым популярным подходом являются Active Record и Data Mapper, все о них слышали, но для того что бы более полно представлять, как развивалась идея, стоит рассказать и о первых двух.

Table Data Gateway

Table Data Gateway, который так же можно встретить под названием DAO (Data Access Object), предоставляет нам объектное представление отдель

@paulirish
paulirish / what-forces-layout.md
Last active April 30, 2024 17:56
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
@ghalusa
ghalusa / youtube_id_regex.php
Created June 20, 2015 23:14
Extract the YouTube Video ID from a URL in PHP
<?php
// Here is a sample of the URLs this regex matches: (there can be more content after the given URL that will be ignored)
// http://youtu.be/dQw4w9WgXcQ
// http://www.youtube.com/embed/dQw4w9WgXcQ
// http://www.youtube.com/watch?v=dQw4w9WgXcQ
// http://www.youtube.com/?v=dQw4w9WgXcQ
// http://www.youtube.com/v/dQw4w9WgXcQ
// http://www.youtube.com/e/dQw4w9WgXcQ
// http://www.youtube.com/user/username#p/u/11/dQw4w9WgXcQ
@esfand
esfand / typescript_angular.adoc
Last active September 30, 2022 12:37
AngularJS with TypeScript
@ScottPhillips
ScottPhillips / .htaccess
Created February 2, 2012 04:30
Common .htaccess Redirects
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/