Skip to content

Instantly share code, notes, and snippets.

@mustafakarali
mustafakarali / gist:fb5c0c959a42175d83ce
Created January 23, 2016 20:20 — forked from plasticbrain/gist:3887245
PHP: mime types (array format)
<?php
$mime_types = array(
'.3dm' => 'x-world/x-3dmf',
'.3dmf' => 'x-world/x-3dmf',
'.a' => 'application/octet-stream',
'.aab' => 'application/x-authorware-bin',
'.aam' => 'application/x-authorware-map',
'.aas' => 'application/x-authorware-seg',
'.abc' => 'text/vnd.abc',
'.acgi' => 'text/html',
@mustafakarali
mustafakarali / remote-file-copy.php
Created December 11, 2015 21:25
Remote file copying with progress reporting in PHP.
<?php
/*
* Remote File Copy PHP Script 2.0.0
*
* Copyright 2012, Sebastian Tschan
* https://blueimp.net
*
* Licensed under the MIT license:
* http://www.opensource.org/licenses/MIT
*/

#Introduction If you're a php developer on ubuntu, there comes the time where you have to install/reinstall your system. I did it already a few times and i decided to write down the steps for a typical web developer stack with php. This is for a developer machine and not for a live environment!

I hope it helps you too!

fyi @mheiniger and me started with an installer here: https://github.com/mheiniger/webdev-setup

#!/bin/bash
#!/bin/sh
rpm -Uvh http://dl.fedoraproject.org/pub/epel/beta/7/x86_64/epel-release-7-0.2.noarch.rpm &&
yum install autoconf automake gcc gcc-c++ git libtool make nasm pkgconfig zlib-devel freetype-devel speex-devel -y &&
mkdir ~/ffmpeg_sources &&
cd ~/ffmpeg_sources &&
curl -O http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz &&
tar xzvf yasm-1.3.0.tar.gz &&
cd yasm-1.3.0 &&
./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin" &&
@mustafakarali
mustafakarali / cli.php
Last active August 29, 2015 14:06 — forked from elliotttf/cli.php
<?php
class cli {
public static $pb_length = 50;
public static $pb_start = '[';
public static $pb_end = ']';
public static $pb_bg = ' ';
public static $pb_fg = '=';
public static $pb_head = '>';
CREATE TABLE IF NOT EXISTS `country` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`iso` char(2) NOT NULL,
`name` varchar(80) NOT NULL,
`nicename` varchar(80) NOT NULL,
`iso3` char(3) DEFAULT NULL,
`numcode` smallint(6) DEFAULT NULL,
`phonecode` int(5) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
<?
include("database.php");
global $db;
$db = new vt("root", "1234", "su", "localhost");
$islem = $_GET["islem"];
if($islem == "il")
{
echo '<option value="">İl seçiniz</option>';
$iller = $db->tablo("select * from il where ilID order by ad asc");