Skip to content

Instantly share code, notes, and snippets.

View RinatMullayanov's full-sized avatar

Rinat Mullayanov RinatMullayanov

View GitHub Profile
@RinatMullayanov
RinatMullayanov / grid-learn.md
Last active May 6, 2017 08:32
CSS Grid Layout

Полезные ссылки

Определения

Grid Layout Concepts and Terminology Grid container — это набор пересекающихся горизонтальных и вертикальных grid линий, которые делят пространство grid контейнера на grid области, в которые могут быть помещены grid элементы. Внутри grid контейнера есть два набора grid линий: один определяет ось столбцов, другой определяет ось строк.

@RinatMullayanov
RinatMullayanov / ECMAScript 6.md
Created April 7, 2016 12:18
Summary of ECMAScript 6

Block Bindings

The current best practice for block bindings is to use const by default and only use let when you know a variable’s value needs to change. This ensures a basic level of immutability in code that can help prevent certain types of errors.

@RinatMullayanov
RinatMullayanov / Dockerfile
Last active August 1, 2023 22:13
Ubuntu Node.js Dockerfile
#
# Ubuntu Node.js Dockerfile
#
# https://github.com/dockerfile/ubuntu/blob/master/Dockerfile
# https://docs.docker.com/examples/nodejs_web_app/
#
# Pull base image.
FROM ubuntu:14.04
(function () {
'use strict';
let user = {};
let proxy = new Proxy(user, {
get(target, prop) {
console.log(`Чтение ${prop}`);
return target[prop];
},
(function () {
'use strict';
let map = new Map();
map.set('1', 'str1'); // key: string
map.set(1, 'num1'); // key: number
map.set(true, 'bool1'); // key: bool
// in ordinary objects that would be the same,
(function () {
'use strict';
let range = {
from: 1,
to: 5
}
// make object range iterable
range[Symbol.iterator] = function() {
// send to current request socket client
socket.emit('message', "this is a test");
// sending to all clients, include sender
io.sockets.emit('message', "this is a test");
// sending to all clients except sender
socket.broadcast.emit('message', "this is a test");
// sending to all clients in 'game' room(channel) except sender
@RinatMullayanov
RinatMullayanov / .bashrc
Last active August 29, 2015 14:23
My vim config
# on OS X file must be named .bash_profile
# real clear screen, not just add new line http://superuser.com/questions/576410/how-can-i-partially-clear-my-terminal-scrollback
alias cls="printf '\e]50;ClearScrollback\a'"
<html>
<head>
<title></title>
</head>
<body>
Hi
<script>
var link = document.createElement('link')
link.setAttribute('rel', 'stylesheet')
link.setAttribute('href', require('path').join(__dirname, 'css', 'app.css'))
@RinatMullayanov
RinatMullayanov / aggregate.js
Last active August 29, 2015 14:21
Mongo Snippet
/*
> for(var i = 0; i < 100000; i++ ) {
db.sample.insert({"value": Math.random(1000) + 1, "date": new Date() });
}
> db.sample.findOne()
{
"_id" : ObjectId("5560cd3bf32e638da3683b38"),
"value" : 1.3218692857772112,
"tag" : "pressure"