Skip to content

Instantly share code, notes, and snippets.

View enamhasan's full-sized avatar

EnamHasan enamhasan

View GitHub Profile
@kwmiebach
kwmiebach / pytest.md
Last active June 4, 2024 06:29 — forked from amatellanes/pytest.sh
pytest cheat sheet

Usage

(Create a symlink pytest for py.test)

pytest [options] [file_or_dir] [file_or_dir] ...

Help:

@ConduciveMammal
ConduciveMammal / handlebars-product-item.liquid
Created April 5, 2018 13:12
Recently Viewed Products with Shopify using localStorage.
<div class="product-item__container">
{% raw %}
{{#unless productAvailable}}
<span class="badge soldout">
<span class="badge-label soldout">Sold out</span>
</span>
{{/unless}}
{{#if onSale}}
{{#unless soldOut}}
@luismts
luismts / GitCommitBestPractices.md
Last active July 4, 2024 21:54
Git Tips and Git Commit Best Practices

Git Commit Best Practices

Basic Rules

Commit Related Changes

A commit should be a wrapper for related changes. For example, fixing two different bugs should produce two separate commits. Small commits make it easier for other developers to understand the changes and roll them back if something went wrong. With tools like the staging area and the ability to stage only parts of a file, Git makes it easy to create very granular commits.

Commit Often

Committing often keeps your commits small and, again, helps you commit only related changes. Moreover, it allows you to share your code more frequently with others. That way it‘s easier for everyone to integrate changes regularly and avoid having merge conflicts. Having large commits and sharing them infrequently, in contrast, makes it hard to solve conflicts.

@vamshigvk
vamshigvk / IBM Data Analysis assignment.ipynb
Created June 3, 2020 08:50
IBM data analysis with python week 6 assignment
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rmiyazaki6499
rmiyazaki6499 / deploy-django.md
Last active June 24, 2024 15:44
Deploying a Production ready Django app on AWS

Deploying a Production ready Django app on AWS

In this tutorial, I will be going over to how to deploy a Django app from start to finish using AWS and EC2. Recently, my partner Tu and I launched our app Hygge Homes (a vacation home rental app for searching and booking vacation homes based off Airbnb) and we wanted to share with other developers some of the lessons we learned along the way.

Following this tutorial, you will have an application that has:

  • An AWS EC2 server configured to host your application
  • SSL-certification with Certbot
  • A custom domain name
  • Continuous deployment with Github Actions/SSM Agent
@enamhasan
enamhasan / Show-inventory Quantity Shopify
Last active March 4, 2022 09:08
Display variant inventory quantiy on product page Shopify
# add this script in product liquid (Just before addtocart form)
<!-- Code added for Inventory in Pipeline -->
<script>
var inv_qty = {};
{% for var in product.variants %}
inv_qty[{{- var.id -}}] = {{ var.inventory_quantity | default: 0 }};
{% endfor %}
</script>
{% if current_variant.inventory_management == "shopify" %}
@atikju
atikju / related-articles.liquid
Created February 25, 2021 11:24
Show related articles based on article tags - Shopify

Docker Best Practices

  • Keep containers stateless.
  • Use COPY instead of ADD.
  • Make COPY last line before CMD or ENTRYPOINT.
    • Each line in the Dockerfile is cached.
    • Separate COPY of requirements.txt from source code.
  • CMD vs ENTRYPOINT: ENTRYPOINT is the main command. Treat CMD as the default flag for the entrypoint. Example: