Skip to content

Instantly share code, notes, and snippets.

View mijankarim's full-sized avatar
:octocat:
Working from home

Mijanul Karim mijankarim

:octocat:
Working from home
  • United Kingdom
View GitHub Profile
@alexhawkins
alexhawkins / nativeJavaScript.js
Last active April 28, 2024 08:52
Implementation of Native JavaScript Methods (forEach, Map, Filter, Reduce, Every, Some)
'use strict';
/*****************NATIVE forEACH*********************/
Array.prototype.myEach = function(callback) {
for (var i = 0; i < this.length; i++)
callback(this[i], i, this);
};
//tests
@ericelliott
ericelliott / essential-javascript-links.md
Last active May 17, 2024 03:38
Essential JavaScript Links
@vasanthk
vasanthk / System Design.md
Last active June 29, 2024 19:22
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@santiago-puchginer-snkeos
santiago-puchginer-snkeos / filterListObjects.js
Last active September 25, 2018 23:28
Filter an array of objects to have "unique" objects with respect some of their properties. Uses new Map from ES6.
// Data
let data = [
{
name: 'John',
SSID: 1
},
{
name: 'John',
SSID: 2
},
@jonlabelle
jonlabelle / windows_to_unix_command_cheat_sheet.md
Last active June 8, 2024 07:54
Windows to UNIX Command Cheat Sheet

Windows to UNIX Command Cheat Sheet

Windows PowerShell has several transition aliases that allow UNIX and CMD users to use familiar command names in Windows PowerShell. The most common aliases are shown in the table below, along with the Windows PowerShell command behind the alias and the standard Windows PowerShell alias if one exists.

CMD Command UNIX Command PowerShell Command PowerShell Alias
dir ls Get-ChildItem gci
@drabbytux
drabbytux / Shipping Calculator for Sections.md
Last active December 23, 2023 11:51
Add a shipping rates calculator to your cart page
  1. Copy this code and paste it at the bottom of your Assets/vendor.js file, or if your theme doesn't have a vendor.js file, place it at the very top of the theme.js file. (At the moment, POP requires this to be added at the very bottom of the theme.js file, followed by the next bit).

  2. Add this to the bottom of the Assets/theme.js file:

Shopify.Cart.ShippingCalculator.show( {
  submitButton: theme.strings.shippingCalcSubmitButton,
  submitButtonDisabled: theme.strings.shippingCalcSubmitButtonDisabled,
  customerIsLoggedIn: theme.strings.shippingCalcCustomerIsLoggedIn,
  moneyFormat: theme.strings.shippingCalcMoneyFormat                                     
@liqtags
liqtags / shopify-liquid-cheatsheet.liquid
Created July 25, 2018 12:03
Shopify Liquid Cheatsheet
Shopify objects that contain attributes that can be dynamically put on the page. For example, the product object contains an attribute called title that can be used to output the title of a product.
The handle is used to access the attributes of a Liquid object. By default, it is the object’s title in lowercase with any spaces and special characters replaced by hyphens (-). Every object in Liquid (product, collection, blog, menu) has a handle.
Collections & Products
Collection ►
all_types ►
Returns a list of all the product types for a collection
@marioloncarek
marioloncarek / ajax-cart.js
Created September 26, 2018 14:06
complete shopify ajax cart solution with drawer and modal, adding and removing products - ugly AF
const defaults = {
cartModal: '.js-ajax-cart-modal', // classname
cartModalContent: '.js-ajax-cart-modal-content', // classname
cartModalClose: '.js-ajax-cart-modal-close', // classname
cartDrawer: '.js-ajax-cart-drawer', // classname
cartDrawerContent: '.js-ajax-cart-drawer-content', // classname
cartDrawerClose: '.js-ajax-cart-drawer-close', // classname
cartDrawerTrigger: '.js-ajax-cart-drawer-trigger', // classname
cartOverlay: '.js-ajax-cart-overlay', // classname
cartCounter: '.js-ajax-cart-counter', // classname
@andreibabor
andreibabor / Shopify: Wholesale + redirect on other page after submit
Last active September 7, 2022 20:43
Shopify: Wholesale + redirect on other page after submit
{% assign header_title = page.title %}
{% include 'page_header' with header_title %}
<div class="wrapper wrapper--margins wrapper__article">
<div class="rte">
<div class="text-center">
{{ page.content }}
</div>
@manashmandal
manashmandal / egghead_downloader.py
Last active May 27, 2019 20:51
Egghead Course Download Script
from lxml import html
import requests
import os
import json
from tqdm import tqdm
COURSES = """https://egghead.io/courses/cycle-js-fundamentals
https://egghead.io/courses/use-d3-v3-to-build-interactive-charts-with-javascript