Skip to content

Instantly share code, notes, and snippets.

View kmishal's full-sized avatar
🎯
Focusing

Kaustubh Mishal kmishal

🎯
Focusing
View GitHub Profile
@milesw
milesw / rcWidget.js
Last active July 21, 2022 16:07
rcWidget.js
import 'core-js/es6/array';
import 'core-js/es6/object';
import 'core-js/es6/string';
// Global options
import defaults from './_config';
// general helper functions
import Helper from './_helpers';
// general pricing and currency functions
import Pricing from './_pricing';
// throttle and debounce manager
@stewartknapman
stewartknapman / shopify-money.js
Created February 27, 2017 23:25
The Shopify.formatMoney method extracted from option_selection.js for stand-alone purposes.
var Shopify = Shopify || {};
// ---------------------------------------------------------------------------
// Money format handler
// ---------------------------------------------------------------------------
Shopify.money_format = "${{amount}}";
Shopify.formatMoney = function(cents, format) {
if (typeof cents == 'string') { cents = cents.replace('.',''); }
var value = '';
var placeholderRegex = /\{\{\s*(\w+)\s*\}\}/;
var formatString = (format || this.money_format);
@mindplace
mindplace / git_and_github_instructions.md
Last active May 1, 2024 00:17
Pushing your first project to github

1. Make sure git is tracking your project locally

Do you need a refresher on git? Go through Codecademy's git course.

  1. Using your terminal/command line, get inside the folder where your project files are kept: cd /path/to/my/codebase. → You cannot do this simply by opening the folder normally, you must do this with the command line/terminal.
    → Do you need a refresher on using your command line/terminal? I've compiled my favorite resources here.

  2. Check if git is already initialized: git status

discounted_product = 12275195905
products_needed = [592406273]
products_seen = []
Input.cart.line_items.each do |line_item|
product = line_item.variant.product
products_seen << product.id if products_needed.include?(product.id)
end
Input.cart.line_items.each do |line_item|
@in4lio
in4lio / vCard_S30.py
Last active April 17, 2024 22:18
Сonvert vCards into suitable for Nokia Series 30+ format
r"""
vCard_S30.py -- Convert vCards into suitable for Nokia Series 30+ format, or
How to solve the only one phone number per contact problem.
1) Import contacts "contacts.vcf" from Google account (vCard format).
2) Place it beside this script.
3) Run the script with Python 2.7.
4) Copy the result "backup.dat" into "Backup" folder on the phone SD card.
5) Restore contacts from backup on the phone.