Skip to content

Instantly share code, notes, and snippets.

View ukadev's full-sized avatar

ukadev ukadev

View GitHub Profile
rm /etc/apache2/sites-available/000-default.conf
cat >> /etc/apache2/sites-available/000-default.conf << EOF
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/public
<Directory /var/www/public>
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order Deny,Allow
@ukadev
ukadev / Contract Killer 3.md
Created March 9, 2019 20:14
The latest version of my ‘killer contract’ for web designers and developers

Contract Killer

The popular open-source contract for web professionals by Stuff & Nonsense

  • Originally published: 23rd December 2008
  • Revised date: March 15th 2016
  • Original post

<?php
/*
|--------------------------------------------------------------------------
| Excel To Array
|--------------------------------------------------------------------------
| Helper function to convert excel sheet to key value array
| Input: path to excel file, set wether excel first row are headers
| Dependencies: PHPExcel.php include needed
*/
function excelToArray($filePath, $header=true){
@ukadev
ukadev / vagrant_lamp_provision.sh
Last active November 6, 2022 16:25
Minimal vagrant provision for lamp on Ubuntu with PHP8.1 with xdebug3 and also composer, phpmyadmin and laravel installer (and virtualhost).
#!/bin/bash
# Set the same ip as in your VagrantFile in order to configure xdebug
VAGRANT_IP= 192.168.33.10
# Here you can set the root mySQL password
MYSQL_PASSWORD="toor"
# For each of the following list, you can enable or disable its installation, setting it to false
# NOTE: You have to enable Apache and MySQL installations to be able to install phpMyAdmin, otherwise it'll be skipped.
sudo apt-get install -y git-core curl zlib1g zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev libsqlite3-0 sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties libffi-dev apache2
sudo apt-get --ignore-missing install -y git-core curl openssl libssl-dev libcurl4-openssl-dev libreadline6 libreadline6-dev libgdm-dev libncurses5-dev automake autoconf libtool bison postgresql postgresql-contrib libpq-dev pgadmin3
gpg --keyserver hkp://keys.gnupg.net --recv-k 409B6B1796C275462A1703113804BB82D39DC0E3
curl -sSL https://get.rvm.io | bash -s stable
source ~/.rvm/scripts/rvm
rvm install 2.3.1
rvm use 2.3.1 --default
@ukadev
ukadev / pecl-memcached.sh
Created April 9, 2016 20:27 — forked from paul91/pecl-memcached.sh
How to install php memcached on CentOS 6.5
#!/bin/bash
# How to install PHP memcached on CentOS 6.5
# Install dependencies
yum install cyrus-sasl-devel zlib-devel gcc-c++
# Get the latest libmemcached
wget https://launchpad.net/libmemcached/1.0/1.0.16/+download/libmemcached-1.0.16.tar.gz
tar -xvf libmemcached-1.0.16.tar.gz
window.history.pushState("string", "test", "/new/url");
<?php
/* * **
*
* This script converts an existing MySQL database to migrations in Laravel 4.
*
* 1. Place this file inside app/controllers/
*
* 2. In this file, edit the index() method to customize this script to your needs.
* - inside $migrate->ignore(), you pass in an array of table