Skip to content

Instantly share code, notes, and snippets.


Slim OUICHTATI slouma2000

View GitHub Profile
View vuejs-filter-limit.txt
Vue.filter('limit', function(array, length) {
var limitCount = parseInt(length, 10);
if (limitCount <= 0) {
("development") !== 'production' && _.warn(
'The limit filter requires an argument defining the limit count.'
return array;
return array.slice(0, limitCount);
slouma2000 / wordpress.sql
Last active Sep 5, 2015 — forked from andredublin/wordpress.sql
Wordpress search and replace for when you move your site
View wordpress.sql
UPDATE wp_options SET option_value = replace(option_value, 'http://localhost:8888/testing', '') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET guid = replace(guid, 'http://localhost:8888/testing','');
UPDATE wp_posts SET post_content = replace(post_content, 'http://localhost:8888/testing', '');
UPDATE wp_postmeta SET meta_value = replace(meta_value,'http://localhost:8888/testing','');
slouma2000 / multipledomains
Created Apr 7, 2015
Multiple domains pointe to the same primarydomain, PLESK 12 change Docmentroot
View multipledomains
1. Create a subscription for the additional domain in Plesk
2. Point the DocumentRoot to your primary Multisite domain
DocumentRoot /var/www/vhosts/
SuexecUserGroup primarydomainuser psacln
<Directory '/var/www/vhosts/'>
AllowOverride All
3. Disable PHP open_basedir
4. Enable PHP to run as FastCGI on the new DocumentRoot
<Directory /var/www/vhosts/>
View 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);
View getFriends
if (typeof jQuery === "undefined") { throw new Error("This application requires jQuery"); }
window.fbAsyncInit = function() {
appId: 'xxxxxxx',
status: true, // check login status
xfbml: true,
version: 'v2.1'
View Ajax Call
var url = 'participants/save';
dataType: 'json',
type: 'POST',
url: url,
cache: false,
data: {
firstname: response.first_name,
slouma2000 / htaccess-laravel
Last active Aug 29, 2015
htaccess laravel
View htaccess-laravel
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
#Options -MultiViews
SetEnv LARAVEL_ENV production
RewriteEngine On
# Redirect Trailing Slashes...
View Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
# For a list of vagrant boxes visit the site below
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
View gist:2b77543c4888f22bb6b5
Apache logs location on Plesk:
Apache Suexec logs location on Plesk:
Access and Error logs for a specific account / user / website on Plesk:
slouma2000 / install_ruby_1.9.3
Last active May 14, 2019
Install Ruby 1.9.3 on CentOS, RedHat using RVM
View install_ruby_1.9.3
Step 1: Upgrade Packages
# yum update
# yum groupinstall "Development Tools"
Step 2: Installing Recommended Packages
# yum install gcc-c++ patch readline readline-devel zlib zlib-devel
# yum install libyaml-devel libffi-devel openssl-devel make
# yum install bzip2 autoconf automake libtool bison iconv-devel
Step 3: Install RVM ( Ruby Version Manager )