Skip to content

Instantly share code, notes, and snippets.

View radjivF's full-sized avatar
🐢
doing some stuff

radjivF radjivF

🐢
doing some stuff
View GitHub Profile
@radjivF
radjivF / next.config.js
Created July 23, 2021 10:54
Fixes npm packages that depend on `fs` module on NextJS
module.exports = {
webpack: (config, { isServer }) => {
// Fixes npm packages that depend on `fs` `net `empty` module
if (!isServer) {
config.node = {
fs: 'empty',
net: 'empty',
tls: 'empty'
}
}
@radjivF
radjivF / product-template.liquid
Last active July 11, 2018 12:38
hide quantity if collection.title something
{% comment %}
replace ligne 265 to 270
and 'something' by the name of the collection
{% endcomment %}
{% if section.settings.show_quantity_selector and collection.title != 'something'%}
<div class="product-form__item product-form__item--quantity">
<label for="Quantity">{{ 'products.product.quantity' | t }}</label>
<input type="number" id="Quantity" name="quantity" value="1" min="1" class="product-form__input" pattern="[0-9]*">
</div>
@radjivF
radjivF / theme.scss.liquid
Created July 10, 2018 10:29
product review shopify app hide customer reviews if none
// copy and past to the bottom of theme.scss.liquid
.spr-badge[data-rating="0.0"] {
visibility:hidden; display: none;
}
@radjivF
radjivF / product.liquid
Last active July 8, 2018 08:24
accordion for shopify product page
{% comment %}
<!--
Liquid will output content, split on h3s like this:
<div class="accordion">
<h5><a href="#free-shipping" data-accordian-action>Free & Fast USA Shipping <span>+</span></a></h5>
<p id="free-shipping" data-accordian-target>All orders are shipped through USPS. We pride ourselves on fast delivery. Orders typically arrive within 2-5 business days. You will receive an email with tracking information when your order is ready to ship.</p>
<h5><a href="#international-shipping" data-accordian-action>International Shipping <span>+</span></a></h5>
<p id="international-shipping" data-accordian-target>International shipping rates vary based on item(s). Shipping rates can be seen on the checkout page. International orders typically arrive within 7-10 business days, but can vary with customs clearance in each country. </p>
</div>
#!/bin/sh
old=radjivC
new=radjivF
git remote -v | grep $old | while read name url type; do
newurl=`echo $url | sed -e "s/$old/$new/"`
git remote set-url $name $newurl
done
@radjivF
radjivF / avoidenterfireringpreviousparent.js
Created March 1, 2018 01:51
enter key trigger parent element by default
$(event.currentTarget).on("keypress", function(event){
if(event.keyCode ===13){
var e = $.Event("focusout");
$(event.currentTarget).trigger(e);
event.preventDefault;
return false;
}
})
@radjivF
radjivF / my-linter
Created January 4, 2018 02:56
Personal linter based on airbnb guideline
{
"extends": [
"eslint:recommended", "plugin:react/recommended", "airbnb"
],
"parser": "babel-eslint",
"env": {
"browser": true,
"node": true,
"mocha": true
},
@radjivF
radjivF / crazy_filter.js
Last active September 8, 2016 07:16
crazy_filter
var supporting_docs;
if (claim_id) {
supporting_docs = supporting_docs.filter(function(cla) {
return cla.claim_id <= claim_id && (my_role === 'CLAIMANT' && cla.claim_status === 'SUBMITTED' ? cla.created_at < cla.claim_submitted_at : true);
});
}
@radjivF
radjivF / conditional_promise.coffee
Created June 14, 2016 08:20
conditional promise in coffeescript
conditional = true
promises_list = []
if conditional?
#if conditional is true run this promises
p.push Promise.conditional conditional
p.push Promise.normal
Promise.all p
handlebars.registerHelper 'json', (context) ->
JSON.stringify context
handlebars.registerHelper 'debug', (value) ->
console.log 'Current Context'
console.log '===================='
console.log this
if value
console.log 'Value'
console.log '===================='