Skip to content

Instantly share code, notes, and snippets.

View kenan-recebli's full-sized avatar

Kənan Rəcəbli kenan-recebli

View GitHub Profile
@kenan-recebli
kenan-recebli / create_virtual_host.py
Last active June 4, 2020 22:50
The script creates a local virtual host and a localhost schema. The script was created for personal use with personal preferences and intented to use in Ubuntu, but anyone can use it. Just change your default site projects' path and install `mysql-connector-python`. That's all.
#!/usr/bin/env python3
import os
import sys
from getpass import getpass
import mysql.connector
host = input('Enter the host: ')
dir = host.title()
@kenan-recebli
kenan-recebli / Validator.php
Last active April 30, 2017 09:01
Day, month and year validation rules for Laravel 5.4
<?php
namespace App\Http\Requests;
class Validator
{
/**
* Validate that an attribute is a valid day.
*
@kenan-recebli
kenan-recebli / animate.js
Created April 15, 2017 11:42
Simple javascript animate function for old browsers
function animate(elem, options, duration, callback, callbackTimeout) {
var start = +new Date,
prop;
for (prop in options) {
var style = getComputedStyle(elem, ''),
value = options[prop],
px = style[prop].slice(-2),
currentValue = px == 'px' ? parseInt(style[prop]) : +style[prop],
unit = px == 'px' ? 'px' : '';