Skip to content

Instantly share code, notes, and snippets.

View aliuygur's full-sized avatar

Ali UYGUR aliuygur

View GitHub Profile
<?php
/**
* Creating date collection between two dates
*
* <code>
* <?php
* # Example 1
* date_range("2014-01-01", "2014-01-20", "+1 day", "m/d/Y");
*
@aliuygur
aliuygur / fix-locale-issue.md
Created December 16, 2014 17:11
ubuntu makinadaki locale problemi ve çözümü. bu problem genelde digitalocean.com dan alınan makinalarda çıkıyor.

lets fix the ubuntu locale issue (digitalocea.com droplets)

1. step, browse locale settings

root@piklook-dev:~# locale
locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=en_US.UTF-8
LANGUAGE=
@aliuygur
aliuygur / denyhosts-remove-ip.sh
Last active December 31, 2015 12:29
Remove specifed IP from denyhosts Worked ubuntu 12.04
#!/bin/bash
echo Removing $1 from denyhosts tables
WORK_DIR=/var/lib/denyhosts/
IP=`echo $1 | sed 's/\./\\\\./g'`
service denyhosts stop
eval "sed -i /$IP/d /etc/hosts.deny"
eval "sed -i /$IP/d ${WORK_DIR}hosts"
eval "sed -i /$IP/d ${WORK_DIR}hosts-restricted"
eval "sed -i /$IP/d ${WORK_DIR}hosts-root"
eval "sed -i /$IP/d ${WORK_DIR}hosts-valid"
@aliuygur
aliuygur / fibonacci.php
Last active February 1, 2017 05:18
php fibonacci
<?php
/**
* Get value of index in fibonacci series
*
* @author Ali OYGUR <[email protected]>
* @param int $n index number
* @return int value of index
*/
function fibonacci($n)
{
@aliuygur
aliuygur / .vimrc
Last active October 6, 2015 13:58
my vimrc
" File-type highlighting and configuration.
" Run :filetype (without args) to see what you may have
" to turn on yourself, or just set them all to be sure.
syntax on
filetype on
filetype plugin on
filetype indent on
" Intuitive backspacing in insert mode
set backspace=indent,eol,start
@aliuygur
aliuygur / countries_list.php
Last active August 16, 2024 17:33
Function: Countries (php countries list array)
<?php
/**
* Countries List
* @return array
*/
function countries()
{
$countries = Array(
'AF' => 'Afghanistan',