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
# frozen_string_literal: true | |
# A dynamic parameterized scope to add a count field. Works with | |
# direct and polymorphic has_many relations. | |
# | |
# Example: | |
# > post = Post.with_counts(:comments, :likes).first | |
# > post.comments_count # contains the count of associated comments | |
# > post.likes_count # contains the count of associated likes | |
# |
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 python3 | |
""" | |
Create a path mapping for VS Code (Xdebug) based on the modman file in the current module directory. | |
Pass the destination Magento directory (without / at the end) as first argument. | |
See: https://github.com/felixfbecker/vscode-php-debug#remote-host-debugging | |
""" | |
import sys | |
import os |
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/bash | |
checkFileOrExitWithMessage() { | |
local filePath="$1" | |
local message="$2" | |
test -f $filePath || { | |
echo "$message" | |
exit 1 | |
} | |
} |
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/bash | |
if [[ $# -ne 2 ]]; then | |
echo "Usage: $0 db_name base_url" | |
exit 1 | |
fi | |
dbName="$1" | |
baseUrl="$2" |
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 | |
class Some_Module_Helper_Data extends Mage_Core_Helper_Abstract | |
{ | |
/** | |
* This method interacts with the database, so it will be mocked for the unit test. | |
*/ | |
public function queryDatabase() | |
{ | |
return $this->getSomeDbData(); |