Skip to content

Instantly share code, notes, and snippets.

View mykyta-shulipa's full-sized avatar

Mykyta Shulipa mykyta-shulipa

  • MyHeritage
  • London, UK
View GitHub Profile
@mykyta-shulipa
mykyta-shulipa / pre-commit.sh
Last active September 28, 2017 13:20 — forked from dahjelle/pre-commit.sh
Pre-commit hook for eslint, linting *only* staged changes without deleted files
#!/bin/bash
for file in $(git diff --diff-filter=d --cached --name-only | grep -E '\.(js|jsx)$')
do
git show ":$file" | node_modules/.bin/eslint --stdin --stdin-filename "$file" # we only want to lint the staged changes, not any un-staged changes
if [ $? -ne 0 ]; then
echo "ESLint failed on staged file '$file'. Please check your code and try again."
exit 1 # exit with failure status
fi
done
@mykyta-shulipa
mykyta-shulipa / video.js
Last active August 29, 2015 14:17 — forked from Drubo/video.js
var child_process = require('child_process'),
sys = require('sys'),
http = require('http'),
parse = require('url').parse,
fs = require('fs');
var spawn = child_process.spawn;
var exec = child_process.exec;

Material Design Spinner

CSS and SVG recreation of the new Google material design loading spinner.

A Pen by Fran Pérez on CodePen.

License.

#!/usr/bin/env node
// USAGE ------
// ============
var shell = require('./shellHelper');
// execute a single shell command
shell.exec('npm test --coverage', function(err){
console.log('executed test');