Skip to content

Instantly share code, notes, and snippets.

@maxlibin
maxlibin / new_gist_file
Created March 26, 2013 10:19
Magento Show review form on catalog page
//the form code lives in app/design/frontend/yourtemplate/default/template/review/form.phtml
//in catalog.xml enable it with:
<block type="review/form" name="product.info.review_form" as="review_form" template="review/form.phtml"/>
<?php echo $this->getChildHtml('review_form'); ?>
@maxlibin
maxlibin / new_gist_file
Created April 23, 2013 04:29
if you installed MAMP and mysql command line returns error
/Applications/MAMP/Library/bin/mysql -u root -p
@maxlibin
maxlibin / gist:5771629
Last active December 18, 2015 10:49
Asia country list in select field
<select name="countries">
<option selected="selected" disabled="disalbed">Select Your Country</option>
<option value="china">China</option>
<option value="India">India</option>
<option value="Indonesia">Indonesia</option>
<option value="Pakistan">Pakistan</option>
<option value="Bangladesh">Bangladesh</option>
<option value="Japan">Japan</option>
<option value="Philippines">Philippines</option>
@maxlibin
maxlibin / nodequery.js
Last active December 24, 2015 21:19
Node.js mongoose query if item exist in array,and insert and update if does not...
exports.user_post_emails = function(req, res){
var emails = [];
Mongoose_Collection.findOne({userId: req.user._id}, function(err, user){
if(!user){
emails[0] = req.body.emails;
new Mongoose_Collection({
emails: emails,
userId:req.user._id
@maxlibin
maxlibin / Snow.markdown
Created November 18, 2013 10:36
A Pen by max.
@maxlibin
maxlibin / A-Pen-by-max.markdown
Created November 19, 2013 08:22
A Pen by max.
@maxlibin
maxlibin / gist:7716158
Created November 30, 2013 06:53
change wordpress phpmyadmin content
UPDATE wp_posts SET post_content = REPLACE(
post_content,
'something',
'to replace here'
)
@maxlibin
maxlibin / gist:11244599
Last active August 29, 2015 14:00
Gulp sample
var g = require('gulp'),
sass = require('gulp-ruby-sass'),
notify = require("gulp-notify"),
changed = require("gulp-changed"),
sftp = require("gulp-sftp"),
watch = require('gulp-watch');
sources = {
sass: "sass/*.scss",
js: "coffee/*.coffee",
@maxlibin
maxlibin / simple-react-example.js
Last active March 9, 2017 11:30
simple react example
// http://mikelambert.me/react/?#rVTBbptAED2brxhxAilZq9fERqocVYrUqlLcWxRVBCYxDbB0d3BiWfx7Z3cxrGkS5xAJyzAwb968fTNZmWoNv2QuV5uizAFfCOtcww2mGYmVrBpZY02wDwAyWWtSbUZSRY2SjY5NdKbbBg+BSw50/OPrEemasLquc3yJ0H2KolG4ZbwrfEjbkiKbAECbQguLII7SvHhhAvEIr5gml7W45olaVUf2HmBRFsnez2XADhb3LZGsgXYNLkP3EIKsV2WRPS3d9351cc81LYW4S84Xc5eRLOaMbgs5Nl0QZIOI3wtN+hNF3KR1XuINVnKL0e9tWvb9es0p+9Kwdh942adkasskmM2mSmlRpU0UmdszcLLDMoHFaBJfpV44n6gvHBiY5d6dQOES7F8HT7gb7udJ3AUzpjQ3nN4Q92v+Kf60uvQSakoJYQn7XhLD8wLC0D5203NYt/dVQafMPD0gbbO+SVVFY02rtO9+jbQ2L6LXqcRTLiv+e8QPcSmRLBr3iYJSxccn2Ckt/qfGwMGe10en7YFb4zly6iz34BnCxTxDQJf0aZxY1E1L/TwSn6ydRtvXMYqLHaGAbaA336iocdKIfzTw7hjChF00zPKhg7lpYeK7wLfeu76bWM8f0am/iLH0xe3d1F9Ti3mj/o5FHJongQ0IJpOlFN0akLt49I/FOrFYBsMo1Mx7in05aa2vqBveoQ7nDL7YWm/Snr3O+nWa7/ouL7beYTfJBstSPsOzVLyjDD7wRajJCiWEWMybJBgzxoVt196RmSynDsblemrP+b47LKtx8k9OhZ8/uHJocDSl9d/Vzx+iV8bW4uQzyGXWVmxJ8bdFtVtjidaNofijz5XJOpct8byFMe+Gfw==
class TodoChild extends React.Component {
constructor(props){
super(props);
}
getItemIndex(e){
e.prev
@maxlibin
maxlibin / # Sublime Emmet JSX Reactjs.md
Created May 24, 2017 03:53 — forked from max-mykhailenko/# Sublime Emmet JSX Reactjs.md
Sublime text 3. Enable Emmet in JSX files with Sublime React plugin

This is no longer needed as Emmet supports JSX - you just need to turn it all on. Did a quick tutorial: http://wesbos.com/emmet-react-jsx-sublime/

Thanks, @wesbos

Problem

  • Using emmet in jsx files
  • Emmet expands text when js autocomplete needed