Skip to content

Instantly share code, notes, and snippets.

View koninka's full-sized avatar

Mark Tertisniy koninka

View GitHub Profile
@koninka
koninka / .nanorc
Created February 6, 2018 01:03
Nano editor conf
set autoindent
set casesensitive
set tabsize 4
set tabstospaces
@koninka
koninka / a2dissite.sh
Created October 11, 2017 14:41
OSx a2dissite
#!/bin/sh
APACHE_DIR="/usr/local/etc/httpd"
CONF="$1"
if [ ! -f "$APACHE_DIR/sites-available/$CONF" ]; then
echo "$APACHE_DIR/sites-available/$CONF does not exist"
exit
@koninka
koninka / a2ensite.sh
Created October 11, 2017 14:40
OSx a2ensite
#!/bin/sh
APACHE_DIR="/usr/local/etc/httpd"
CONF="$1"
if [ ! -f "$APACHE_DIR/sites-available/$CONF" ]; then
echo "$APACHE_DIR/sites-available/$CONF does not exist"
exit
@koninka
koninka / pre-commit
Last active August 29, 2015 14:15
Git pre-commit hook to add a new line at the end of a file and remove trailing whitespaces
#!/bin/bash
files=$(git diff-index --name-status --cached HEAD | grep -v ^D | cut -c3-)
if [ "$files" != "" ]
then
for f in $files
do
# Only examine known text files
if [[ "$f" =~ [.](conf|css|less|erb|html|js|json|log|properties|rb|ru|txt|xml|yml|php|twig)$ ]]
then