Find attribute_id
SELECT * FROM eav_attribute where attribute_code = 'is_anchor'
Update all of them with anchor_id from above (usually is ID 51)
UPDATE `catalog_category_entity_int` set value = 1 where attribute_id = 51
// loop through the 'paper' variable from Raphael JS and build up the JSON object describing all images and paths within it. | |
loadJSON = function(paper, json) { | |
var set = paper.set(); | |
$.each(json, function(index, node) { | |
try { | |
var el = paper[node.type]().attr(node); | |
set.push(el); | |
} catch(e) {} | |
}); | |
return set; |
<?php | |
/** | |
* Custom Route class that restricts a route to a single extension. | |
* Enables you to build controller actions that are only applied to specific | |
* extensions, e.g., '/posts.json' goes to PostsController::index_json while | |
* '/posts' goes to PostsController::index. | |
* | |
* To use, drop this into app/libs/routes/extension_specific_route.php and add | |
* the following to the top of app/config/routes.php: | |
* |
<?php | |
/** | |
* Super-simple AWS CloudFront Invalidation Script | |
* | |
* Steps: | |
* 1. Set your AWS access_key | |
* 2. Set your AWS secret_key | |
* 3. Set your CloudFront Distribution ID | |
* 4. Define the batch of paths to invalidate | |
* 5. Run it on the command-line with: php cf-invalidate.php |
/** | |
* function: array_columns | |
* author: Brecht Cloetens | |
* params: $a = array() // original array | |
* $c = int() // number of columns | |
*/ | |
function array_columns(&$a, $c=2) | |
{ | |
$m = ceil(count($a)/$c); | |
$j = 0; |
# Put this in the vhost.conf... otherwise remove the directory wrappers when using as an htaccess... but use it in the vhost.conf, not the htaccess. | |
# Allow traffic from IP without login | |
SetEnvIf Remote_Addr ^11\.11\.11\.11$ MOVE_ALONG=true | |
# Allow traffic from any iPhone user agent without login | |
SetEnvIfNoCase User-Agent iPhone MOVE_ALONG=true | |
<Directory "/var/www/vhosts/vhost.com/httpdocs"> | |
Satisfy Any | |
Order deny,allow |
This Gist is a collection of configuration files that can be used to easily setup a Homebrew-based LEMP stack on Mac OS X.
Files in this repository are numbered and named for ordering purposes only. At the top of each file is a section of metadata that denote what component the file belongs to and the default name & location of the file. Feel free to implement it however you want.
Note: some configuration files have hard-coded paths to my user directory -- fix it for your setup
<?php | |
/* | |
* Place this with the rest of your rules. | |
* Doesn't need to be in an array as there are no pipes. | |
* Password is required with a minimum of 6 characters | |
* Should have at least 1 lowercase AND 1 uppercase AND 1 number | |
*/ | |
$rules = [ | |
'password' => 'required|min:6|regex:/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d).+$/' | |
]; |
server { | |
listen 443; | |
server_name example.com; | |
error_log /var/log/nginx/example_com_error.log warn; | |
ssl on; | |
ssl_certificate /etc/nginx/ssl/your.crt; #certificate chains | |
ssl_certificate_key /etc/nginx/ssl/your.key; #private key | |