Skip to content

Instantly share code, notes, and snippets.

Olivier Lance olance

Block or report user

Report or block olance

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@olance
olance / instructions.md
Last active Dec 12, 2019
Script Shopify Plus permettant de désactiver les moyens de paiement Alma lorsque le panier est trop faible ou trop élevé, ou que le pays de livraison n'est pas la France
View instructions.md

Ne fonctionne que pour les clients Shopify Plus, les clients Shopify "standard" n'ayant pas accès à l'app Script Editor.

Le code fourni a été généré avec l'outil Shopify Script Creator ; vous pouvez l'utiliser vous-mêmes pour créer des scénarios plus complexes si besoin.

Instructions

  1. Installez l'app Script Editor sur votre boutique
  2. Dans l'app ("Apps" dans la colonne de gauche puis "Script Editor"), cliquez sur le bouton "Create Script"
  3. Sélectionnez "Payment gateways" et "Blank template", puis cliquez sur "Create script"
@olance
olance / postgres_create_readonly_user.sql
Created May 28, 2019
A snippet to quickly create a read-only user for a postgresql DB
View postgres_create_readonly_user.sql
CREATE user <username> with encrypted password '<password>';
GRANT CONNECT ON DATABASE <db_name> TO <username>;
GRANT USAGE ON SCHEMA public TO <username>;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO <username>;
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO <username>;
@olance
olance / CartTotals.php
Created Dec 12, 2018
[MAGENTO 2] Injecting data into Cart data
View CartTotals.php
<?php
namespace Vendor\Module\Plugin\Checkout\CustomerData;
class CartTotals
{
/**
* @var \Magento\Customer\Model\Session
*/
protected $checkoutSession;
View facet_widget.js
instantsearch.widgets.singleFacet = function singleFacet(options) {
// Using Hogan to compile the given template. Feel free to use anything else ;)
options.template = Hogan.compile(options.template);
var $container = $(options.container);
return {
getConfiguration: function(/*currentSearchParams*/) {
// Make sure the facet used for this widget is declared
return {
@olance
olance / parse_nested_query.py
Last active Aug 29, 2015 — forked from john1king/parse_nested_query.py
Parses a query string to obtain a params dict as it's done in Rails using Rack's Utils lib.
View parse_nested_query.py
# This is a port from https://github.com/rack/rack/blob/master/lib/rack/utils.rb from john1king,
# forked to be fixed, completed & documented
import re
import urllib
class RangeError(Exception):
pass
@olance
olance / command output
Created Oct 3, 2013
Error with RVM 1.22.15 trying to install ruby-1.8.7-p370
View command output
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/10.7/x86_64/ruby-1.8.7-p370.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Checking requirements for osx.
Somehow it happened there is no executable 'openssl',
run 'brew doctor' and make sure latest 'openssl' is installed properly.
RVM autolibs is now configured with mode '2' => 'check and stop if missing',
please run `rvm autolibs enable` to let RVM do its job or run and read `rvm autolibs [help]`
or visit https://rvm.io/rvm/autolibs for more information.
You can’t perform that action at this time.