Skip to content

Instantly share code, notes, and snippets.

Looking for a job

Rinat Valiullov RinatValiullov

Looking for a job
View GitHub Profile
RinatValiullov /
Last active Jan 24, 2022
IIFE, scopes, explanation
What is the output of this code?
var a = 5; // (1)
!function(x) { // (2)
  a = x; // (3)
}(7); // (4)

console.log(a); // a = 7 (5)
RinatValiullov / main.dart
Created Dec 17, 2021
Simple Flutter App(wip)
View main.dart
import 'package:flutter/material.dart';
void main() {
class MyApp extends StatelessWidget {
Widget build(BuildContext context) {
return MaterialApp(
RinatValiullov /
Created Oct 26, 2020 — forked from siddMahen/
Prim's algorithm, in Python.
from sys import argv
import re
# open the file and get read to read data
file = open(argv[1], "r");
p = re.compile("\d+");
# initialize the graph
vertices, edges = map(int, p.findall(file.readline()))
graph = [[0]*vertices for _ in range(vertices)]
RinatValiullov / distributeFiles.js
Created Feb 21, 2020
Move compiled(tsc) js files in parent directories next to `src` dirs. And delete `dist` folder created after compilation in the root directory
View distributeFiles.js
const fs = require('fs');
const path = require('path');
const exec = require('child_process').exec;
const createDirectory = dirPath => {
const targetFolder = '/dist';
fs.mkdirSync(process.cwd() + (dirPath + targetFolder), { recursive: true }, (error) => {
if(error) {
RinatValiullov /
Created Jan 20, 2020 — forked from pythoninthegrass/
Update to Vim8 on Centos 7
# SOURCE: @zhouyanlt
sudo yum install -y gcc git ncurses-devel
git clone ~/vim
cd ~/vim/src
make distclean # if you built Vim before
make -j8
sudo make install
cp -ru ~/vim/src/vim /usr/bin # overwrites /usr/bin/vim w/o confirmation

There are certain files created by particular editors, IDEs, operating systems, etc., that do not belong in a repository. But adding system-specific files to the repo's .gitignore is considered a poor practice. This file should only exclude files and directories that are a part of the package that should not be versioned (such as the node_modules directory) as well as files that are generated (and regenerated) as artifacts of a build process.

All other files should be in your own global gitignore file. Create a file called .gitignore in your home directory and add anything you want to ignore. You then need to tell git where your global gitignore file is.


git config --global core.excludesfile ~/.gitignore


git config --global core.excludesfile %USERPROFILE%\.gitignore
RinatValiullov / sentiment-index.js
Last active Dec 3, 2019
For translation of article "Natural language processing for Node.js" -
View sentiment-index.js
// index.js
var natural = require('natural');
var Analyzer = natural.SentimentAnalyzer;
var stemmer = natural.PorterStemmer;
var analyzer = new Analyzer("English", stemmer, "afinn");
// getSentiment ожидает массив строк
console.log(analyzer.getSentiment(["I", "don't", "want", "to", "play", "with", "you"]));
RinatValiullov / string_distance-index.js
Last active Dec 2, 2019
For translation of article "Natural language processing for Node.js" -
View string_distance-index.js
// index.js
var natural = require('natural');
console.log(natural.HammingDistance("karolin", "kathrin", false));
console.log(natural.HammingDistance("karolin", "kerstin", false));
console.log(natural.HammingDistance("short string", "longer string", false));
RinatValiullov / classification-index.js
Last active Dec 2, 2019
For translation of article "Natural language processing for Node.js" -
View classification-index.js
// index.js
var natural = require('natural');
var classifier = new natural.BayesClassifier();
classifier.addDocument('i am long qqqq', 'buy');
classifier.addDocument('buy the q\'s', 'buy');
classifier.addDocument('short gold', 'sell');
classifier.addDocument('sell gold', 'sell');
RinatValiullov / spell-output.js
Created Nov 29, 2019
For translation of article "Natural language processing for Node.js" -
View spell-output.js
[ 'something' ]
[ 'something', 'soothing' ]