Skip to content

Instantly share code, notes, and snippets.

View RinatMullayanov's full-sized avatar

Rinat Mullayanov RinatMullayanov

View GitHub Profile
@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
@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 / atom.txt
Created May 6, 2015 06:51
Atom: Unable to install packages behind corporate proxy https://github.com/atom/apm/issues/322
Seems that node-gyp isn't following the 302 Redirect sent by atom.io.
@fujisaks Thanks for pointing to the problem!
I've been able to workaround the issue by setting the ATOM_NODE_URL env variable to the new url (after redirect ). This should also be working after you update Atom. However, remove the entry when the bug gets fixed!
Windows temporary:
set ATOM_NODE_URL=http://gh-contractor-zcbenz.s3.amazonaws.com/atom-shell/dist
Windows permanently:
@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 / native_promise_sample.js
Last active September 18, 2015 11:26
Notes about promises
function updateTask(oldTask, newTask) {
var promise = new Promise(function (resolve, reject) {
resolve({status: 'success'});
// resolve(Error('some error'));
});
return promise;
}
(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'"