Skip to content

Instantly share code, notes, and snippets.

View markshust's full-sized avatar
🤓
Working on educational & training material for Magento 2

Mark Shust markshust

🤓
Working on educational & training material for Magento 2
View GitHub Profile
@markshust
markshust / gist:5071757
Created March 2, 2013 16:17
cleanup sass indentation and formatting
sass-convert --from scss --to scss --in-place path/to/file.scss
@markshust
markshust / gist:5073706
Created March 2, 2013 23:14
Magento - get product by sku
$product = Mage::helper('catalog/product')->getProduct('SKU_GOES_HERE', Mage::app()->getStore()->getId(), 'sku');
@markshust
markshust / gist:5217479
Created March 21, 2013 22:41
skew font with css
http://jsfiddle.net/89x4d/102/
div {
width: 200px;
height:50px;
background: red;
-webkit-transform: skew(14deg);
-moz-transform: skew(14deg);
-o-transform: skew(14deg);
transform: skew(14deg);
public function getMainImage()
{
$mainImage = $this->getSkinUrl('images/pd/bettercontact/contacts-main-image.jpg');
//Set main image from system config if it exist
if ($image = Mage::getStoreConfig('contacts/contacts/main_image', Mage_Catalog_Model_Abstract::DEFAULT_STORE_ID)) {
$mainImage = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA) . 'contacts' . DS . $image;
}
return $mainImage;
@markshust
markshust / opect.com.html
Created May 2, 2013 14:22
First record of any web code I've done
<HTML>
<HEAD>
<TITLE>Opect Web Design / Graphic Design - Professional web design for businesses looking for a spot on the web.</TITLE>
<META NAME="description" CONTENT="Professional web design for businesses looking for a spot on the web. All web site packages are very flexible, and you can have unlimited graphics designed by us on every page.">
<META NAME="keywords" CONTENT="site designing, page designing, web host provider, web design, site design, page design, web host service, web hosting, best web host, professional web designing, web designer, web designers, domain hosting, free web hosting, web host, web hosting service, web page designer, virtual host, web designing, web page designers, web site designers, web site designer, professional web design, virtual domain hosting, web page designing, web site designing, free web host, virtual web host, graphic design firm, computer graphic designer, web graphic designer, graphic design, freelance graphic designer, web graphics, graphic designer, free web gra
@markshust
markshust / 30-char-alpha-excel-marco
Created June 21, 2013 16:43
Excel Macro to create 30-char alphanumeric strings and insert into currently selected cells
Sub createRandstring30()
Set MyRange = Selection
Dim randstring As String
Dim i As Integer
For Each mycell In MyRange
randstring = ""
Randomize
For i = 1 To 30
If Int((2 * Rnd) + 1) = 1 Then
randstring = randstring & Chr(Int(26 * Rnd + 65))
@markshust
markshust / gist:6097507
Last active January 3, 2018 11:24
upgrade mysql client tools from 5.5 to 5.6 on ubuntu
sudo add-apt-repository ppa:ondrej/mysql-experimental
sudo apt-get update
sudo apt-get remove mysql-client-5.5
sudo apt-get install mysql-client-5.6
@markshust
markshust / jquery.strpad.js
Last active December 20, 2015 10:49
jquery.strpad.js
/**
* Function that imitates PHP's str_pad.
*
* @param input string
* @param padLength string
* @param padString string
* @param padType string
* @returns string
*/
jQuery.strPad = function(input, padLength, padString, padType) {
@markshust
markshust / magento-mysql.5.6-innodb-fix.diff
Last active December 23, 2015 04:39
Magento - MySQL 5.6 InnoDB fix
diff --git a/app/code/core/Mage/Install/Model/Installer/Db/Mysql4.php b/app/code/core/Mage/Install/Model/Installer/Db/Mysql4.php
index bc482b5..ebd5875 100644
--- a/app/code/core/Mage/Install/Model/Installer/Db/Mysql4.php
+++ b/app/code/core/Mage/Install/Model/Installer/Db/Mysql4.php
@@ -59,7 +59,7 @@ class Mage_Install_Model_Installer_Db_Mysql4 extends Mage_Install_Model_Installe
public function supportEngine()
{
$variables = $this->_getConnection()
- ->fetchPairs('SHOW VARIABLES');
- return (!isset($variables['have_innodb']) || $variables['have_innodb'] != 'YES') ? false : true;
@markshust
markshust / mysql_myisam_to_innodb.php
Created February 25, 2014 17:08
PHP script to convert MySQL tables from MyISAM to InnoDB
<?php
$conn = mysql_connect('server', 'username', 'password');
mysql_select_db('database', $conn);
$sql = "SELECT table_name FROM INFORMATION_SCHEMA.TABLES WHERE engine <> 'InnoDB'";
$rs = mysql_query($sql);
while ($row = mysql_fetch_array($rs)) {
$tbl = $row[0];
$sql = "ALTER TABLE $tbl ENGINE=INNODB";