Skip to content

Instantly share code, notes, and snippets.

View groggu's full-sized avatar
🏠
Working from home

Greg Croasdill groggu

🏠
Working from home
View GitHub Profile
@groggu
groggu / Sony ILCE-6000 (Rokinion 14mm).lcp
Created August 17, 2015 14:31
Adobe Lens description file for Rokinion 14mm Lens
<?xpacket begin="" id="W5M0MpCehiHzreSzNTczkc9d"?>
<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Adobe XMP Core 4.4.0-c007 1.126898, 2008/09/29-20:23:32 ">
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:Description rdf:about=""
xmlns:photoshop="http://ns.adobe.com/photoshop/1.0/"
xmlns:stCamera="http://ns.adobe.com/photoshop/1.0/camera-profile">
<photoshop:CameraProfiles>
<rdf:Seq>
<rdf:li rdf:parseType="Resource">
<stCamera:Author>Thomas Berndt (www.photo-worX.de) - Modified for Sony by Greg Croasdill</stCamera:Author>
@groggu
groggu / slit_csv.sh
Created August 17, 2015 14:28
Great script to split up large CSV files into parts. Change the term "filename" below to be the csv file name and change the 25000 to be the number of lines in each split file.
tail -n +2 filename.csv | split -l 25000 - filename_
for file in filename_*
do
head -n 1 filename.csv > tmp_file
cat $file >> tmp_file
mv -f tmp_file $file.csv
done
@groggu
groggu / gist:a384f5a2c3fcfd376edc
Last active August 29, 2015 14:16
htaccess file compression and caching settings for Magento
Update Expires time to increase Browser Caching
At the beginning of the <IfModule mod_expires.c> section replace
<IfModule mod_expires.c>
############################################
## Add default Expires header
## http://developer.yahoo.com/performance/rules.html#expires
ExpiresDefault "access plus 1 year"
@groggu
groggu / foo.sql
Created March 5, 2015 20:09
Get the size of all your mysql databases
SELECT
table_schema as "db name",
SUM( data_length + index_length) / 1024 / 1024 as "Data Base Size in MB"
FROM
information_schema.TABLES
GROUP BY
table_schema;
@groggu
groggu / .gitignore
Created March 5, 2015 20:06
magento default .gitignore
# General web stuff
/.htaccess
/robots.txt
/sitemap.xml
/google*
# Dynamic Magento data that doesn't need to be in the repo
/var/*
/media/*
@groggu
groggu / checkinvidx.sql
Created October 24, 2014 14:56
Magento - Validate stock against index values for all simple products
SELECT DISTINCT
catalog_product_entity.entity_id,
catalog_product_entity.sku,
catalog_product_entity.type_id,
cataloginventory_stock_item.qty AS `stock qty`,
cataloginventory_stock_item.is_in_stock,
cataloginventory_stock_status_idx.qty AS `idx qty`,
cataloginventory_stock_status_idx.stock_status
FROM cataloginventory_stock_item INNER JOIN cataloginventory_stock_status_idx ON cataloginventory_stock_item.product_id = cataloginventory_stock_status_idx.product_id
INNER JOIN catalog_product_entity ON catalog_product_entity.entity_id = cataloginventory_stock_item.product_id
@groggu
groggu / getconfigstock.sql
Last active August 29, 2015 14:08
Magento - Get configurable product's total stock qty and is_in_stock status using one child's product ID
SELECT
count(product_id),
sum(cataloginventory_stock_item.qty) as child_qty,
sum(cataloginventory_stock_item.is_in_stock) > 0 as some_child_in_stock
FROM cataloginventory_stock_item
WHERE product_id in (
SELECT
parent.product_id
FROM
catalog_product_super_link as parent