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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
import static com.googlecode.javacv.cpp.opencv_core.*; | |
import static com.googlecode.javacv.cpp.opencv_highgui.*; | |
import static com.googlecode.javacv.cpp.opencv_imgproc.*; | |
public class circleDetection{ | |
public static void main(String[] args){ | |
IplImage src = cvLoadImage("img2.png"); | |
IplImage gray = cvCreateImage(cvGetSize(src), 8, 1); | |
cvCvtColor(src, gray, CV_BGR2GRAY); |
<?php | |
Illuminate\Routing\UrlGenerator | |
__construct(RouteCollection $routes, Request $request) Both parameter ar from Symfony | |
full() // Get the full URL for the current request. | |
current() // Get the current URL for the request. | |
previous() // Get the URL for the previous request. | |
to($path, $parameters = array(), $secure = null) // Generate a absolute URL to the given path. | |
secure($path, $parameters = array()) // Generate a secure, absolute URL to the given path. | |
asset($path, $secure = null) // Generate a URL to an application asset. |
<?php | |
/* | |
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
import arrow | |
import boto3 | |
import uuid | |
dynamodb = boto3.client('dynamodb') | |
some_id = uuid.uuid4() | |
some_time = arrow.now() | |
request = { | |
'ConsistentRead': False, |
When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:
var Article = require('../../../models/article');
Those suck for maintenance and they're ugly.
# update | |
sudo yum -y update | |
sudo yum -y upgrade | |
# enable EPEL6 by changing enabled=0 -> enabled=1 | |
sudo vim /etc/yum.repos.d/epel.repo | |
# install htop | |
sudo yum install htop |
var crypto = require('crypto'); | |
var WSProtocolHandler = { | |
"8":{ | |
handshake:function(req,socket,head,callback){ | |
var key = req.headers["sec-websocket-key"]; | |
if(!key)return false; | |
key += "258EAFA5-E914-47DA-95CA-C5AB0DC85B11"; | |
var sha1 = crypto.createHash('sha1'); | |
sha1.update(key); |