Skip to content

Instantly share code, notes, and snippets.

Avatar

Rinat Mullayanov RinatMullayanov

View GitHub Profile
View grid-learn.md

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

Определения

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

View ECMAScript 6.md

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 Nov 16, 2020
Ubuntu Node.js Dockerfile
View 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
View proxy-sample.js
(function () {
'use strict';
let user = {};
let proxy = new Proxy(user, {
get(target, prop) {
console.log(`Чтение ${prop}`);
return target[prop];
},
View map-sample.js
(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,
View es2015-iterator-sample.js
(function () {
'use strict';
let range = {
from: 1,
to: 5
}
// make object range iterable
range[Symbol.iterator] = function() {
View socket_io_sample.js
// 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
View .bashrc
# 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'"
View electron-reliable-css-path.html
<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'))
View aggregate.js
/*
> 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"