Skip to content

Instantly share code, notes, and snippets.

View Igcorreia's full-sized avatar
💡
Finding new Challenges

Ignacio Correia Igcorreia

💡
Finding new Challenges
View GitHub Profile
<?php
if ( fusion_is_element_enabled( 'fusion_hero' ) ) {
if ( ! class_exists( 'FusionSC_FusionHero' ) ) {
/**
* Shortcode class.
*
* @package fusion-builder
* @since 1.0
*/
/*!
*
* Version :
* Emmanuel B. (www.emmanuelbeziat.com)
* https://github.com/EmmanuelBeziat/
**/
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
@neochief
neochief / localized-hello.js
Last active May 2, 2020 21:26
Localized salutations by country (for websites and emails)
/**
* Salutations in different languages transliterated to English.
*
* This can be used on websites or email campaigns which do not
* have full localization, but if their owner still wants to
* provide basic level of "locale-friendliness" to its users.
*
* The key of the list is ISO ALPHA-3 country code.
*
* Note that the list does not include English speaking countries
@jawinn
jawinn / primary_category.php
Last active December 8, 2022 21:42
Display Primary Category (Yoast's WordPress SEO)
<?php
/**
* Get the Yoast primary category from its post meta value, and displays it, with HTML markup.
* If there is no primary category set, it displays the first assigned category.
*
* @param boolean $useCatLink Whether to link the category, if it exists
* @return void
*/
function yourtheme_display_yoast_primary_category( $useCatLink = true ) {
@fer-ri
fer-ri / restart-service.sh
Last active May 7, 2023 11:39
Auto Restart PHP5-FPM When Down or Bad Gateway
#!/bin/bash
if curl --head -sf http://yourdomain.com/some-script.php -o /dev/null; then
echo "PHP FPM is up"
else
service php5-fpm restart && service nginx restart && service mysql restart
echo "Opps .. service was down" | mail -s "PHP-FPM Service Down" yourmail@domain.com -aFrom:cron@yourmail.com
fi
@roddds
roddds / gist:a1f42bae598028ac7809
Last active December 8, 2020 22:46 — forked from raddevon/gist:67935d320ee9b726d19d
Adobe tries to strong-arm me into keeping Creative Cloud

To everyone who got here through Twitter or Facebook or Hacker News or whatever: THIS IS NOT ME.

The "Me" in this transcript is @raddevon, who shared his story first on reddit.


List of incompetent jackasses who can't check a source if their lives depended on it:

@PhilETaylor
PhilETaylor / masterplugin.php
Last active July 4, 2021 08:59 — forked from jneubauer/masterplugin.php
Joomla! plugin that fires all possible plugin events
<?php
// no direct access
defined( '_JEXEC' ) or die( 'Restricted access' );
jimport('joomla.log.log');
class PlgSystemMasterplug extends JPlugin
{
function onExtensionBeforeInstall(){
JLog::add(JText::_('onExtensionBeforeInstall'), JLog::WARNING);
# sets the proxy cache path location, max size 2g
proxy_cache_path /data/nginx/cache levels=1:2 keys_zone=STATIC:100m inactive=24h max_size=2g;
# transfers the `Host` header to the backend
proxy_set_header Host $host;
# uses the defined STATIC cache zone
proxy_cache STATIC;
# cache 200 10 minutes, 404 1 minute, others status codes not cached
@leek
leek / reset_permissions.sh
Created September 30, 2013 15:50
Magento - Simple reset file permissions script
#!/bin/bash
#
# Found on StackOverflow:
# http://stackoverflow.com/a/9304264/3765
#
if [ ! -f ./app/etc/local.xml.template ]; then
echo "-- ERROR"
echo "-- This doesn't look like a Magento install. Please make sure"
echo "-- that you are running this from the Magento main doc root dir"
@jakebellacera
jakebellacera / ICS.php
Last active July 10, 2024 11:27
A convenient script to generate iCalendar (.ics) files on the fly in PHP.
<?php
/**
* This is free and unencumbered software released into the public domain.
*
* Anyone is free to copy, modify, publish, use, compile, sell, or
* distribute this software, either in source code form or as a compiled
* binary, for any purpose, commercial or non-commercial, and by any
* means.
*