This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
/** | |
* Calculate the greatest common divisor (GCD) of two numbers. | |
* @param {number} a - First number | |
* @param {number} b - Second number | |
* @returns {number} - The GCD of the two numbers | |
*/ | |
function gcd(a, b) { | |
return (b === 0) ? a : gcd(b, a % b); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh -e | |
# dont echo anything, comment out if needed | |
echo() { :; } | |
# DB settings | |
USER="user" | |
DATABASE="db" | |
HOST="127.0.0.1" | |
DIRECTORY="dumps" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
wp () { | |
command /usr/local/bin/php7.2.11-cli ~/wp-cli/wp-cli.phar "$@" | |
} | |
for plugins in $(wp plugin list --path='../html/' --update=available --fields=name,version,update_version --format=csv); | |
do | |
IFS=', ' read -r -a plugin <<< "$plugins" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function wecGenerateMenu($menu_name) { | |
$menu = wp_get_nav_menu_object($menu_name); | |
$locations = get_nav_menu_locations(); | |
$menu = wp_get_nav_menu_object( $locations[ $menu_name ] ); | |
$menuitems = wp_get_nav_menu_items( $menu->term_id, array( 'order' => 'DESC' ) ); | |
$count = 0; | |
$content_ = ""; | |
$submenu = false; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function basename(path) { | |
return path.split('/').reverse()[0]; | |
} | |
var gulp = require('gulp'), | |
less = require('gulp-less'), | |
sourcemaps = require('gulp-sourcemaps'); | |
concat = require('gulp-concat'), | |
rename = require('gulp-rename'), | |
path = require('path'), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace ShyimCron; | |
use Shopware\Components\Plugin; | |
use Shopware\Components\Plugin\Context\InstallContext; | |
use Shopware\Components\Plugin\Context\UninstallContext; | |
class ShyimCron extends Plugin { | |
public static function getSubscribedEvents() | |
{ | |
return [ | |
'Shopware_CronJob_MyCoolCron' => 'MyCoolCronRun' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Custom Classes for the wordpress WYSIWYG editor | |
*/ | |
add_filter( 'tiny_mce_before_init', 'custom_mce_before_init' ); | |
function custom_mce_before_init( $settings ) { | |
$style_formats = array( | |
array( | |
'title' => 'Title for style', | |
'selector' => 'li', |