This content from this markdown file has moved a new, happier home where it can serve more people. Please check it out : https://docs.microsoft.com/azure/azure-cache-for-redis/cache-best-practices.
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
| string secret = "[shopify-multipass-secret]"; | |
| string store = "[shopify-store]"; | |
| var json = System.Text.Json.JsonSerializer.Serialize(new { | |
| email = "[customer-email]", | |
| created_at = DateTime.Now.ToString("O"), | |
| identifier = "[customer-uid]", | |
| //remote_ip = "" | |
| }); | |
| var hash = System.Security.Cryptography.SHA256.Create().ComputeHash(Encoding.UTF8.GetBytes(secret)); |
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
| # Note: it is a copy of great answer by "mgoldwasser" from Stackoverflow | |
| # Check the original answer here: http://stackoverflow.com/a/26018934/1032439 | |
| # Imagine that post1, post5, and post1000 are posts objects with ids 1, 5 and 1000 respectively | |
| # The goal is to "upsert" these posts. | |
| # we initialize a dict which maps id to the post object | |
| my_new_posts = {1: post1, 5: post5, 1000: post1000} | |
| for each in posts.query.filter(posts.id.in_(my_new_posts.keys())).all(): |
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
| import uuid | |
| import wtforms_json | |
| from sqlalchemy import not_ | |
| from sqlalchemy.dialects.postgresql import UUID | |
| from wtforms import Form | |
| from wtforms.fields import FormField, FieldList | |
| from wtforms.validators import Length | |
| from flask import current_app as app | |
| from flask import request, json, jsonify, abort |
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
| USE magentositedb; | |
| TRUNCATE `magento_dataflow_batch_export`; | |
| TRUNCATE `magento_dataflow_batch_import`; | |
| TRUNCATE `magento_log_customer`; | |
| TRUNCATE `magento_log_quote`; | |
| TRUNCATE `magento_log_summary`; | |
| TRUNCATE `magento_log_summary_type`; | |
| TRUNCATE `magento_log_url`; | |
| TRUNCATE `magento_log_url_info`; |
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
| <block type="cms/block" name="block_name"> | |
| <action method="setBlockId"><id>block_code</id></action> | |
| </block> | |
| {{block type="cms/block" block_id="block_code"}} | |
| {{block type="catalog/product_list" category_id="79" template="catalog/product/list_random.phtml"}} |