Skip to content

Instantly share code, notes, and snippets.

View JFOC's full-sized avatar
🎯
Focusing

JFOC JFOC

🎯
Focusing
View GitHub Profile
@JFOC
JFOC / vworkapp.js
Created December 7, 2015 09:51 — forked from aishfenton/vworkapp.js
vWorkApp Javascript Script
// ------------------------------------------------------------------------------------------------------------------//
// vWorkApp Core Library
// ------------------------------------------------------------------------------------------------------------------//
var vWorkAppScript = vWorkAppScript || {};
vWorkAppScript.host = "api.vworkapp.com";
vWorkAppScript.apiToken = "PUT YOUR API KEY HERE"
(function() {
@JFOC
JFOC / App\Exceptions\Handler.php
Created February 2, 2018 04:11 — forked from jacurtis/App\Exceptions\Handler.php
How to get filp/whoops to work in Laravel 5.2 or 5.3 - Add this code to your `App\Exceptions\Handler.php` file.
/**
* Create a Symfony response for the given exception.
*
* @param \Exception $e
* @return mixed
*/
protected function convertExceptionToResponse(Exception $e)
{
if (config('app.debug')) {
$whoops = new \Whoops\Run;
  1. Make sure mysql-client is installed. If not, then :
    sudo apt install mysql-client
	or
    sudo apt-get install mysql-client
  1. Open php.ini

; PHP's default character set is set to UTF-8.

@JFOC
JFOC / mamp-php-gmp.md
Created October 28, 2021 06:46 — forked from aurelioluiz/mamp-php-gmp.md
How to install GMP extension for PHP 7.2 using MAMP

Installing GMP extension for PHP 7.2 using MAMP

You have to build the GMP extension from the PHP source code. First install Autoconf and GMP using Homebrew.

brew install autoconf gmp

Download and unpack PHP.

@JFOC
JFOC / pint.json
Created January 14, 2023 04:56 — forked from JustSteveKing/pint.json
Laravel Pint configuration
{
"preset": "psr12",
"rules": {
"align_multiline_comment": true,
"array_indentation": true,
"array_syntax": true,
"blank_line_after_namespace": true,
"blank_line_after_opening_tag": true,
"combine_consecutive_issets": true,
"combine_consecutive_unsets": true,
@JFOC
JFOC / common.php
Created August 4, 2024 13:03 — forked from relliv/common.php
Secure GET & POST Methods
<?php
class Common
{
/*--------------------- $_GET & $_POST ----------------- START */
/**
* Get $_GET content, array or array item in filtered way
*
* @param object $parameter could be array or array item
@JFOC
JFOC / remove-spam-users.sql
Created September 9, 2024 10:53 — forked from yanknudtskov/remove-spam-users.sql
Delete SPAM users from WordPress/WooCommerce. They usually never have a first name set
# Use with EXTREME CAUTION
DELETE FROM wp_users WHERE ID IN ( SELECT user_id FROM wp_usermeta
WHERE meta_key = 'wp_capabilities' AND meta_value LIKE '%subscriber%'
AND user_id NOT IN ( SELECT user_id FROM wp_usermeta
WHERE meta_key = 'billing_first_name' AND meta_value != ''
AND user_id IN ( SELECT user_id FROM wp_usermeta
WHERE meta_key = 'wp_capabilities' AND meta_value LIKE '%subscriber%' ) ) )
DELETE FROM wp_usermeta WHERE user_id IN ( SELECT user_id FROM wp_usermeta
@JFOC
JFOC / wp_make_new_site.sh
Created November 26, 2024 14:51 — forked from romanitalian/wp_make_new_site.sh
BASH script to make new WP site: download and WP, configure and restart NGINX; install/make wordpress site by Bash script; wordpress install; wordpress configuration; wordpress initialisation
#!/bin/bash
# -------------------------------------------------
# Make site directory
# Download WP and install WP to site directory
# Set WP configuration
# Configure NGINX for new domain-name
# -------------------------------------------------
# apt-get update
@JFOC
JFOC / breadcrumbs-custom.php
Created December 23, 2024 16:41 — forked from hemusyl/breadcrumbs-custom.php
WordPress custom breadcrumbs without plugin
http://www.qualitytuts.com/wordpress-custom-breadcrumbs-without-plugin/
Step 1
Breadcrumbs are the important part of our website, in wordpress there are several plugins are available for this, but below i posted
the code for custom breadcrumbs for our wordpress site. Just add this below code in to your current wordpress theme functions.php
and call the second step.
<?php
function qt_custom_breadcrumbs() {