<?php
/**
* @method DbTable_Row_Foo createRow()
*/
class DbTable_Foo extends Zend_Db_Table_Abstract
{
protected $_primary = 'foo_id';
protected $_name = 'foo';
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
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteCond %{REQUEST_URI} ^/wp-content/uploads/[^\/]*/.*$ | |
RewriteRule ^(.*)$ https://<DOMAIN>/$1 [QSA,L] | |
</IfModule> |
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 | |
// Alternative: | |
// Install https://github.com/roots/soil | |
// Add slug to <body> class | |
add_filter('body_class', function ($classes) { | |
// Add post/page slug if not present | |
if (is_single() || is_page() && !is_front_page()) { | |
if (!in_array($slug = basename(get_permalink()), $classes)) { |
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 | |
/** | |
* Add SRI attributes to external JS resources | |
*/ | |
function add_sri_attribute($tag, $handle, $src = null) | |
{ | |
$known_hashes = array( | |
'https://code.jquery.com/jquery-1.12.4.min.js' => 'sha256-ZosEbRLbNQzLpnKIkEdrPv7lOy9C27hHQ+Xp8a4MxAQ=', | |
); |
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 | |
# | |
# 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 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 [ ! -f ./app/etc/config.php ]; then | |
echo "-- ERROR" | |
echo "-- This doesn't look like a Magento 2 install. Please make sure" | |
echo "-- that you are running this from the Magento main doc root dir" | |
exit | |
fi | |
echo -ne '\n' |
Git Flow is an extension to Git that provides extra functionality and simple commands that force you into a structured and proper branching model. Git Flow is not required and in fact all commands ran by Git Flow can be done using standard Git commands. Git Flow just makes everything easier. Git Flow only needs to be installed on the developer's machine (or wherever development happens) and not on any production server.
Git Flow can be installed alongside TortoiseGit without issue, but there are some steps needed.
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 App\Providers; | |
use Illuminate\Support\ServiceProvider; | |
class ConfigServiceProvider extends ServiceProvider | |
{ | |
/** | |
* Overwrite any vendor / package configuration. |
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
/** | |
* 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 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'); |