Skip to content

Instantly share code, notes, and snippets.

View akaguny's full-sized avatar
🏠
Working from home

Alexey akaguny

🏠
Working from home
View GitHub Profile
@akaguny
akaguny / GitHub-Forking.md
Created March 3, 2018 06:30 — forked from Chaser324/GitHub-Forking.md
GitHub Standard Fork & Pull Request Workflow

Whether you're trying to give back to the open source community or collaborating on your own projects, knowing how to properly fork and generate pull requests is essential. Unfortunately, it's quite easy to make mistakes or not know what you should do when you're initially learning the process. I know that I certainly had considerable initial trouble with it, and I found a lot of the information on GitHub and around the internet to be rather piecemeal and incomplete - part of the process described here, another there, common hangups in a different place, and so on.

In an attempt to coallate this information for myself and others, this short tutorial is what I've found to be fairly standard procedure for creating a fork, doing your work, issuing a pull request, and merging that pull request back into the original project.

Creating a Fork

Just head over to the GitHub page and click the "Fork" button. It's just that simple. Once you've done that, you can use your favorite git client to clone your repo or j

@akaguny
akaguny / pre-commit.sh
Created September 28, 2017 13:20 — forked from mykyta-shulipa/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
@akaguny
akaguny / index.html
Created February 8, 2017 06:24 — forked from anonymous/index.html
JS Bin // source http://jsbin.com/kiziri
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.1/angular.js"></script>
<meta charset=utf-8 />
<title>JS Bin</title>
<style id="jsbin-css">
.ng-modal-overlay {
/* A dark translucent div that covers the whole screen */
position:absolute;
@akaguny
akaguny / mocha-guide-to-testing.js
Created July 6, 2016 10:50 — forked from samwize/mocha-guide-to-testing.js
Explain Mocha's testing framework - describe(), it() and before()/etc hooks
// # Mocha Guide to Testing
// Objective is to explain describe(), it(), and before()/etc hooks
// 1. `describe()` is merely for grouping, which you can nest as deep
// 2. `it()` is a test case
// 3. `before()`, `beforeEach()`, `after()`, `afterEach()` are hooks to run
// before/after first/each it() or describe().
//
// Which means, `before()` is run before first it()/describe()
@akaguny
akaguny / xampp.sh
Last active February 7, 2021 05:10 — forked from dflynn15/xampp.sh
Linux bash script to write to XAMPP vhost and add symbolic link.
#!/bin/bash
# Format of command: ./xampp.sh new.website.name.com
# arguments: name=virtual adress site
# edited files by script: /opt/lampp/etc/extra/httpd-vhosts.conf, /etc/hosts
XAMPP_DIR="/opt/lampp" # Youre installation folder
PROJECTS_DIR="/home/alexey/webprojects" # Youre projects folder
#todo: change /home/alexey to variable $HOME, but if run script whit sudo $home = root
PROJECT_DIR="$PROJECTS_DIR/$1"
# Number of expected arguments