Skip to content

Instantly share code, notes, and snippets.

View mobber007's full-sized avatar
🎯
Focusing

mobber007 mobber007

🎯
Focusing
View GitHub Profile
@mobber007
mobber007 / fixCurrentPageReload.js
Created March 22, 2019 11:26
fix current page reload
function fixCurrentPageReload(location, hrefSelectors){
$j( hrefSelectors ).each(function( index ) {
var loc = $j( this ).attr("href").replace(/\//g, "");
var pathname = location.pathname.replace(/\//g, "");
if(typeof loc !== 'undefined' && loc.indexOf(pathname) !== -1 || typeof loc !== 'undefined' && loc === pathname){
$j( this ).click(function(e){
e.preventDefault();
});
}
});
@mobber007
mobber007 / stellar.js
Created March 30, 2019 13:03
SCBR js file
var $j = jQuery.noConflict();
var EN ={
added: "Product was added to wishlist",
removed: "Product was removed from wishlist",
addedToCart: "Product was added to cart"
};
var langs = EN;
window.isAuthenticated=function() {
var cookie = $j( "body" ).hasClass("logged-in");
if(cookie){
@mobber007
mobber007 / holirepo.js
Created April 8, 2019 13:51
JS & jQuery repo
function appendScript(src, destination){
var s = document.createElement("script");
s.type = "text/javascript";
s.src = src;
destination.appendChild(s);
}
function authenticated(){
var cookie = $j( "body" ).hasClass("logged-in");
if(cookie){
return true;
@mobber007
mobber007 / two-way-binding.js
Created May 8, 2019 11:24 — forked from straker/two-way-binding.js
Simple and small two-way data binding between DOM and data
/**
* @param {object} scope - Object that all bound data will be attached to.
*/
function twoWayBind(scope) {
// a list of all bindings used in the DOM
// @example
// { 'person.name': [<input type="text" data-bind="person.name"/>] }
var bindings = {};
// each bindings old value to be compared for changes
{{-- Define all our servers --}}
@servers(['staging' => '', 'production' => ''])
@setup
{{-- The timezone your servers run in --}}
$timezone = 'Europe/Amsterdam';
{{-- The base path where your deployments are sitting --}}
$path = '/var/www/site.com/htdocs';
@mobber007
mobber007 / packages.json
Last active February 25, 2020 16:55
packages.json
{
"avada-theme": {
"name": "Avada Theme",
"slug": "avada-theme",
"img": "https://wpstarterpack.com/wp-content/uploads/2019/07/av.jpg",
"type": "theme",
"category": "top-100-plus",
"tagline": "responsive multi-purpose theme",
"description": "top1 best selling wordpress theme!",
"oldPrice": "save $60"
@mobber007
mobber007 / install-ispconfig-nginx-ubuntu.sh
Created April 1, 2020 17:07
Install Nginx ISPConfig3 Ubuntu 18.04 64Bits
#!/bin/bash
## Install ISPConfig3 on Ubuntu 18.04 64Bits
## Author: Nilton OS blog.linuxpro.com.br
## http://blog.linuxpro.com.br/posts/instalando-ispconfig3-no-ubuntu-1404.html
## https://www.howtoforge.com/community/threads/perfect-server-for-ubuntu-16-but-with-nginx-instead-of-apache-socket-permission-issues.72883/
## https://www.howtoforge.com/tutorial/perfect-server-ubuntu-18-04-nginx-bind-dovecot-and-ispconfig-3/
## Reconfigure Dash
echo "dash dash/sh boolean false" | debconf-set-selections
@mobber007
mobber007 / functions.php
Created May 9, 2020 14:35 — forked from butlerblog/functions.php
SMTP using wp-config.php for settings
<?php // Don't use this line.
/**
* This function will connect wp_mail to your authenticated
* SMTP server. This improves reliability of wp_mail, and
* avoids many potential problems.
*
* For instructions on the use of this script, see:
* https://www.butlerblog.com/2013/12/12/easy-smtp-email-wordpress-wp_mail/
*
@mobber007
mobber007 / php-pools.md
Created December 9, 2020 11:18 — forked from holmberd/php-pools.md
Adjusting child processes for PHP-FPM (Nginx)

Adjusting child processes for PHP-FPM (Nginx)

When setting these options consider the following:

  • How long is your average request?
  • What is the maximum number of simultaneous visitors the site(s) get?
  • How much memory on average does each child process consume?

Determine if the max_children limit has been reached.

  • sudo grep max_children /var/log/php?.?-fpm.log.1 /var/log/php?.?-fpm.log
@mobber007
mobber007 / disable-comments.sh
Created January 13, 2021 10:24 — forked from jplhomer/disable-comments.sh
Disable all comments/pings in WordPress with WP-CLI
$ wp post list --format=ids | xargs wp post update --comment_status=closed
# Output:
# Success: Updated post 2514.
# Success: Updated post 2511.
# Success: Updated post 2504.
# Success: Updated post 2499.
# Success: Updated post 2441.
# etc...