Skip to content

Instantly share code, notes, and snippets.

View AKovalevich's full-sized avatar

Artem Kovalevich AKovalevich

View GitHub Profile
@AKovalevich
AKovalevich / nginx
Created July 26, 2016 16:15 — forked from vdel26/nginx
Openresty init.d script
#!/bin/sh
#
# chkconfig: 2345 55 25
# Description: Nginx init.d script, put in /etc/init.d, chmod +x /etc/init.d/nginx
# For Debian, run: update-rc.d -f nginx defaults
# For CentOS, run: chkconfig --add nginx
#
### BEGIN INIT INFO
# Provides: nginx
# Required-Start: $all
#!/bin/bash
# sudo ./init.sh [Directory] [MySQL Host] [MySQL User] [MySQL Password] [MySQL Database name]
curl -sS https://getcomposer.org/installer | sudo php — —install-dir=/usr/local/bin —filename=composer
if [ ! -d "$1" ]; then
echo 'Directory do not exist.';
exit 1
fi
chmod +x $1 -R
cd $1;
@AKovalevich
AKovalevich / custom.js
Last active February 10, 2016 12:54
Drupal js filesize validation
(function ($) {
var mytheme = mytheme || {};
/**
* Client-side file input validation of filesize.
*/
mytheme.validateFileSize = function (event) {
// Define variables.
var filesize = event.data.size;
@AKovalevich
AKovalevich / 0_reuse_code.js
Created October 1, 2015 08:30
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console