Skip to content

Instantly share code, notes, and snippets.

View slouma2000's full-sized avatar
🐝
Venven

Slim OUICHTATI slouma2000

🐝
Venven
  • MAKE IT DIGITAL TUNISIA
  • TUNISIA
View GitHub Profile
Apache logs location on Plesk:
/var/log/httpd/access_log
/var/log/httpd/error_log
Apache Suexec logs location on Plesk:
/var/log/httpd/suexec_log
Access and Error logs for a specific account / user / website on Plesk:
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
# For a list of vagrant boxes visit the site below
# http://www.vagrantbox.es/
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
@slouma2000
slouma2000 / htaccess-laravel
Last active August 29, 2015 14:07
htaccess laravel
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
#Options -MultiViews
</IfModule>
SetEnv LARAVEL_ENV production
RewriteEngine On
# Redirect Trailing Slashes...
@slouma2000
slouma2000 / Ajax Call
Created October 20, 2014 11:03
Ajax jQuery
var url = 'participants/save';
$.ajax({
dataType: 'json',
type: 'POST',
url: url,
cache: false,
data: {
fbid: response.id,
fullname: response.name,
firstname: response.first_name,
@slouma2000
slouma2000 / getFriends
Created November 1, 2014 08:27
getFriends
<script>
if (typeof jQuery === "undefined") { throw new Error("This application requires jQuery"); }
window.fbAsyncInit = function() {
FB.init({
appId: 'xxxxxxx',
status: true, // check login status
xfbml: true,
version: 'v2.1'
});
@slouma2000
slouma2000 / getDeviceOrientation
Created November 8, 2014 07:47
getDeviceOrientation
function getDeviceOrientation() {
// window.innerHeight is not supported by IE
var winH = window.innerHeight ? window.innerHeight : jQuery(window).height();
var winW = window.innerWidth ? window.innerWidth : jQuery(window).width();
//force height for iframe usage
if(!winH || winH == 0){
winH = '100%';
}
// set the height of the document
jQuery('html').css('height', winH);
@slouma2000
slouma2000 / multipledomains
Created April 7, 2015 10:12
Multiple domains pointe to the same primarydomain, PLESK 12 change Docmentroot
1. Create a subscription for the additional domain in Plesk
2. Point the DocumentRoot to your primary Multisite domain
DocumentRoot /var/www/vhosts/primarydomain.com/httpdocs
SuexecUserGroup primarydomainuser psacln
<Directory '/var/www/vhosts/primarydomain.com/httpdocs'>
AllowOverride All
</Directory>
3. Disable PHP open_basedir
4. Enable PHP to run as FastCGI on the new DocumentRoot
<Directory /var/www/vhosts/primarydomain.com/httpdocs>
@slouma2000
slouma2000 / wordpress.sql
Last active September 5, 2015 03:00 — forked from andredublin/wordpress.sql
Wordpress search and replace for when you move your site
UPDATE wp_options SET option_value = replace(option_value, 'http://localhost:8888/testing', 'http://www.live-website.com') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET guid = replace(guid, 'http://localhost:8888/testing','http://www.live-website.com');
UPDATE wp_posts SET post_content = replace(post_content, 'http://localhost:8888/testing', 'http://www.live-website.com');
UPDATE wp_postmeta SET meta_value = replace(meta_value,'http://localhost:8888/testing','http://www.live-website.com');
@slouma2000
slouma2000 / jsAddSlashes
Created April 16, 2013 22:07
jsAddSlashes
function jsAddSlashes($str) {
$pattern = array(
"/\\\\/" , "/\n/" , "/\r/" , "/\"/" ,
"/\'/" , "/&/" , "/</" , "/>/"
);
$replace = array(
"\\\\\\\\", "\\n" , "\\r" , "\\\"" ,
"\\'" , "\\x26" , "\\x3C" , "\\x3E"
);
return preg_replace($pattern, $replace, $str);
ini_set('display_errors', 1);
ini_set('log_errors', 1);
ini_set('error_log', dirname(__FILE__) . '/error_log.txt');
error_reporting(E_ALL);