Skip to content

Instantly share code, notes, and snippets.

@oliverservin
oliverservin / install_mariadb_serverpilot.md
Last active November 15, 2016 01:01
How to Upgrade MySQL 5.5 to MariaDB 10.1 on Ubuntu 14.04 and ServerPilot
sudo ln -s /etc/apparmor.d/usr.sbin.mysqld /etc/apparmor.d/disable
sudo invoke-rc.d apparmor restart
sudo replace log_slow_queries slow_query_log_file -- /etc/mysql/conf.d/mysqld_slow_log.cnf
sudo bash -c 'echo "slow_query_log = 1" >> /etc/mysql/conf.d/mysqld_slow_log.cnf'
sudo apt-get purge --assume-yes mysql-server mysql-server-5.5 mysql-server-core-5.5 mysql-client mysql-client-5.5 mysql-client-core-5.5
sudo apt-get autoremove --assume-yes
sudo apt-get install software-properties-common
sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xcbcb082a1bb943db
sudo add-apt-repository 'deb [arch=amd64,i386] http://mariadb.mirror.anstey.ca/repo/10.1/ubuntu trusty main'
@oliverservin
oliverservin / social.php
Created November 8, 2018 20:16
social.php
<?php
/**
* Social auth class
*
* @package OC
* @category Core
* @author Chema <chema@open-classifieds.com>, Slobodan <slobodan@open-classifieds.com>
* @copyright (c) 2009-2013 Open Classifieds Team
* @license GPL v3
*/
<?php defined('SYSPATH') or die('No direct script access.');
class Controller_Panel_Myads extends Auth_Frontcontroller {
public function action_index()
{
$cat = new Model_Category();
$list_cat = $cat->find_all(); // get all to print at sidebar view
<?php defined('SYSPATH') or die('No direct script access.');?>
<section id="page-header">
<div class="container no-gutter">
<div class="row">
<div class="col-sm-8">
<h1 class="h1"><?=_e('Checkout')?></h1>
</div>
<?if (Theme::get('breadcrumb')==1):?>
<div class="col-sm-4 breadcrumbs">
@oliverservin
oliverservin / orange-blue-style.css
Created July 29, 2020 14:42
Splash theme color fix
.slider-overlay {
background: #256FB2;
}
.categories .categorie {
border: 1px solid #256FB2;
}
.categories .categorie:hover,
.categories .categorie:focus,
.categories .categorie.active {
border-color: #FF781D;
<?php defined('SYSPATH') or die('No direct script access.');
class Controller_Panel_Category extends Auth_Crud {
/**
* @var $_index_fields ORM fields shown in index
*/
protected $_index_fields = array('name','order','price', 'id_category', 'id_category_parent');
/**
<form x-data="initialData()" x-init="init()" x-on:trix-action-invoke="if ($event.actionName == 'x-horizontal-rule') insertHorizontalRule($event)">
<input id="x" type="hidden" name="content">
<trix-editor x-ref="trix" input="x"></trix-editor>
</form>
@oliverservin
oliverservin / core.php
Created April 28, 2022 19:57
oc/classes/core.php
<?php defined('SYSPATH') or die('No direct script access.');
/**
* Core class for OC common, contains commons functions and helpers
*
* @package OC
* @category Core
* @author Chema <chema@open-classifieds.com>
* @copyright (c) 2009-2013 Open Classifieds Team
* @license GPL v3
*/
@oliverservin
oliverservin / ad.php
Created April 28, 2022 19:58
oc/classes/model/ad.php
<?php defined('SYSPATH') or die('No direct script access.');
/**
* description...
*
* @author Chema <chema@open-classifieds.com>
* @package OC
* @copyright (c) 2009-2013 Open Classifieds Team
* @license GPL v3
*
*/
@oliverservin
oliverservin / Dockerfile
Last active June 23, 2022 22:04
Fly.io: PHP 8.1 Dockerfile
# syntax = docker/dockerfile:experimental
FROM alpine:edge as base
LABEL fly_launch_runtime="laravel"
RUN apk update \
&& apk add curl zip unzip tzdata supervisor nginx htop vim ca-certificates \
php81 php81-cli \
php81-soap php81-openssl php81-gmp \
php81-pdo_odbc php81-json php81-dom \