Skip to content

Instantly share code, notes, and snippets.

View mcanvar's full-sized avatar
🛵
Scootering in the wonderland.

Mevlüt Canvar mcanvar

🛵
Scootering in the wonderland.
View GitHub Profile
@mcanvar
mcanvar / setup.sh
Created November 16, 2023 00:38 — forked from marulitua/setup.sh
Instal php5.6 with phpbrew on ubuntu 18.04
#!/bin/bash
# Instal php5.6 with phpbrew on ubuntu 18.04
# Install all dependencies
sudo apt update
sudo apt install wget php build-essential libxml2-dev libxslt1-dev libbz2-dev libcurl4-openssl-dev libmcrypt-dev libreadline-dev libssl-dev autoconf
wget https://github.com/phpbrew/phpbrew/raw/master/phpbrew
chmod +x phpbrew
mv phpbrew /usr/local/bin
@mcanvar
mcanvar / deploy.sh
Created August 19, 2021 14:46 — forked from BenSampo/deploy.sh
Laravel deploy script
# Change to the project directory
cd $FORGE_SITE_PATH
# Turn on maintenance mode
php artisan down || true
# Pull the latest changes from the git repository
# git reset --hard
# git clean -df
git pull origin $FORGE_SITE_BRANCH
<?php
$show_after_p = 2;
$content = apply_filters('the_content', $post->post_content);
if(substr_count($content, '<p>') > $show_after_p)
{
$contents = explode("</p>", $content);
$p_count = 1;
foreach($contents as $content)
{
echo $content;
@mcanvar
mcanvar / 002_create_sessions.php
Last active August 22, 2016 11:17 — forked from harris21/Migration Create Sessions
Create CodeIgniter Sessions Migration
<?php
/**
* Created by PhpStorm.
* User: mevlutcanvar@gmail.com
* Date: 22.08.2016
* Time: 04:58
*/
class Migration_Create_Sessions extends CI_Migration {