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
/* | |
Author: Aleksandar Janković, [email protected] | |
Description: Main javascript file for Google Chrome plugin Chrasks. It uses | |
localStorage technology for saving tasks data. | |
*/ | |
// Declaring Chrasks object | |
function Chrasks(){ | |
var me = this; | |
this.taskForm = document.getElementById('task-form'); |
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 | |
/** | |
* Used to get the current viewed node (works when viewed in page mode). | |
* @param array $node_types[optional] A filter on the type of node you want to see. | |
* @return object The node or null if not successfull. | |
*/ | |
function helper_get_current_node($node_types = array()) { | |
// Store the current node id, to avoid doing the URL testing | |
// on every call to this function. I didn't store the node itself | |
// because I was afraid of data changes during page processing. |
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
SELECT config_id, path, value FROM core_config_data WHERE value LIKE "http%" AND path LIKE "%web%"; |
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 TABLE_NAME set FIELD_NAME = replace(FIELD_NAME, 'find this string', 'replace found string with this string'); |
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
" General "{{{ | |
set encoding=UTF-8 | |
set nocompatible " be iMproved | |
set history=256 " Number of things to remember in history. | |
set timeoutlen=250 " Time to wait after ESC (default causes an annoying delay) | |
set clipboard+=unnamed " Yanks go on clipboard instead. | |
set pastetoggle=<F10> " toggle between paste and normal: for 'safer' pasting from keyboard | |
set shiftround " round indent to multiple of 'shiftwidth' | |
set tags=./tags;$HOME " walk directory tree upto $HOME looking for tags |
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
$product = Mage::getModel('catalog/product') | |
->setStoreId($store->getId()) | |
->load($product->getId()); | |
$gallery = $product->getMediaGallery(); | |
$mediaAttribute = array('image', 'small_image', 'thumbnail'); | |
if($gallery && count($gallery['images'])) { | |
$product_attributes = $product->getTypeInstance()->getSetAttributes(); | |
$gal_backend = $product_attributes['media_gallery']->getBackend(); |
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
// I want to see errors | |
error_reporting(E_ALL); | |
ini_set('display_errors', '1'); | |
// Modify the PHP Environment | |
ini_set('memory_limit', '2048M'); | |
// Load Up Magento Core | |
define('MAGENTO', realpath('..')); | |
require_once(MAGENTO . '/app/Mage.php'); |
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 | |
Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($collection); | |
Mage::getSingleton('catalog/product_visibility')->addVisibleInCatalogFilterToCollection($collection); | |
Mage::getSingleton('cataloginventory/stock')->addInStockFilterToCollection($collection); | |
$collection->addAttributeToFilter('is_saleable', TRUE); |
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
log_customer | |
log_visitor | |
log_visitor_info | |
log_url | |
log_url_info | |
log_quote | |
report_viewed_product_index | |
report_compared_product_index | |
report_event | |
catalog_compare_item |
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
WITH models AS ( | |
WITH data AS ( | |
SELECT | |
replace(initcap(table_name::text), '_', '') table_name, | |
replace(initcap(column_name::text), '_', '') column_name, | |
CASE data_type | |
WHEN 'timestamp without time zone' THEN 'time.Time' | |
WHEN 'timestamp with time zone' THEN 'time.Time' | |
WHEN 'boolean' THEN 'bool' | |
-- add your own type converters as needed or it will default to 'string' |
OlderNewer