Skip to content

Instantly share code, notes, and snippets.

View fnnzzz's full-sized avatar

Vlad Feninets fnnzzz

View GitHub Profile
@fnnzzz
fnnzzz / docker-sftp.txt
Created June 29, 2017 17:54
docker sftp
docker run --restart=always --name=sftp \
-v D:/docker_pub:/home/fnnzzz/upload \
-p 22:22 -d atmoz/sftp \
foo:pass:1001
@fnnzzz
fnnzzz / cli.sh
Created June 22, 2017 09:51
recover git
# find deleted file full path
git log --diff-filter=D --summary --name-only | grep Step1.ascx.en.resx
# find commit where file was deleted by its full path
git log --all --full-history --no-merges -- Rabota2.WebUI/Controls/Service/App_LocalResources/SocialNetworkLogin.ascx.en.resx
# recover deleted file
git checkout 4a23be713e084b53149d2ba6bac441b26e20bdff~1 Rabota2.WebUI/Controls/Service/App_LocalResources/SocialNetworkLogin.ascx.en.resx
@fnnzzz
fnnzzz / isInViewport.js
Created June 15, 2017 15:17
check if element in viewport
const isInViewPort = (el) => {
const win = $(window)
const viewport = {
top : win.scrollTop(),
left : win.scrollLeft()
}
viewport.right = viewport.left + win.width()
viewport.bottom = viewport.top + win.height()
@fnnzzz
fnnzzz / readme.md
Last active May 18, 2017 11:57
Recommendator

Recommendator


How use:

  1. Импортим к себе в файлик src/commons/recommendator.js
  2. Описываем шаблончик на Mustache, например
    const myTemplate = `<h2>Total count: {{ total }}</h2>
    	{{ #documents }}
 {{ name }}
@fnnzzz
fnnzzz / class_of.js
Created April 24, 2017 14:52
classOf (sorax)
const classOf = (object) => Object.prototype.toString.call(object).slice(8, -1)
@fnnzzz
fnnzzz / fadeOut.js
Created March 1, 2017 13:44
fadeOut on vanilla JS
fadeOut(el) {
el.style.opacity = 1;
(function fade() {
if ((el.style.opacity -= 0.03) < 0) {
el.style.display = "none";
} else {
requestAnimationFrame(fade);
}
})();
@fnnzzz
fnnzzz / file_watchers_webstorm.xml
Created February 24, 2017 14:55
Webstorm file watchers
<TaskOptions>
<TaskOptions>
<option name="arguments" value="$FilePathRelativeToProjectRoot$ --out-dir dist --source-maps --presets es2015" />
<option name="checkSyntaxErrors" value="true" />
<option name="description" />
<option name="exitCodeBehavior" value="ERROR" />
<option name="fileExtension" value="js" />
<option name="immediateSync" value="true" />
<option name="name" value="Babel" />
<option name="output" value="dist\$FileDirRelativeToProjectRoot$\$FileNameWithoutExtension$.js:dist\$FileDirRelativeToProjectRoot$\$FileNameWithoutExtension$.js.map" />
@fnnzzz
fnnzzz / rua-autoreg.js
Last active February 16, 2017 09:31
rabotaua autregistration
const rabotauaAutoRegistration = (function() {
function init() {
if( location.pathname == '/employer/register' || location.pathname == '/ua/employer/register' ) {
loadFaker()
}
else {
console.error('Aha got you! This isn`t a page of employer registration')
}
}
@fnnzzz
fnnzzz / webstorm-cheat-sheet.md
Created January 18, 2017 09:24 — forked from kwmiebach/webstorm-cheat-sheet.md
Webstorm cheat sheet
@fnnzzz
fnnzzz / index.html
Created January 16, 2017 15:34
React CDN
<!DOCTYPE html>
<html>
<head>
<title>React cdn</title>
</head>
<body>
<div id="root"></div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.4.2/react.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.4.2/react-dom.min.js"></script>
<script src="https://unpkg.com/babel-standalone@6/babel.js"></script>