These set of scripts are for Magento 2. For Magento 1, see this Gist.
This file contains hidden or 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 App\Providers; | |
use Illuminate\Support\ServiceProvider; | |
class ConfigServiceProvider extends ServiceProvider | |
{ | |
/** | |
* Overwrite any vendor / package configuration. |
This file contains hidden or 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
for (var i = 1; i <= 100; i++) { | |
if (i % 15 === 0) { | |
console.log('FizzBuzz'); | |
} else if (i % 3 === 0) { | |
console.log('Fizz'); | |
} else if (i % 5 === 0) { | |
console.log('Buzz'); | |
} else { | |
console.log(i); | |
} |
Includes:
- Configuration
- BrowserSync
- Environments (e.g.,:
--environment=production
) - Image optimization (gif, jpg, png, and svg)
- Sass compilation with external libraries
- Bower installed Sass libraries example(s)
- CSS processing with Pleeease
This file contains hidden or 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
/** | |
* Disable and enable event on scroll begin and scroll end. | |
* @see http://www.thecssninja.com/javascript/pointer-events-60fps | |
*/ | |
(function(r, t) { | |
window.addEventListener('scroll', function() { | |
// User scrolling so stop the timeout | |
clearTimeout(t); | |
// Pointer events has not already been disabled. | |
if (!r.style.pointerEvents) { |
This file contains hidden or 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 app\controllers; | |
use app\models\Downloads; | |
class DownloadsController extends \lithium\action\Controller { | |
public function index() { | |
$this->request->privateKeys = array('id', 'user_id'); |
This file contains hidden or 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 | |
# | |
# 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" |
This file contains hidden or 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
UPDATE cms_block SET content = REPLACE(content, "http://www.example.com/", "{{store url=''}}"); | |
UPDATE cms_page SET content = REPLACE(content, "http://www.example.com/", "{{store url=''}}"); | |
-- | |
-- AW_Blog Only | |
-- | |
UPDATE aw_blog SET post_content = REPLACE(post_content, 'http://www.example.com/', "{{store url=''}}"); |
All custom modules should have a Namespace and Module Name.
These are used below as {Namespace}
and {Module}
.
Caution: The Magento autoloader is known to have problems with CamelCase namespaces and/or modules between Windows and *nix systems. If your module requires more than one word for either of these, it is best to just concatenate them to avoid any issues (Example:
{Namespace}_{Examplemodule}
).