Skip to content

Instantly share code, notes, and snippets.

View bourroush's full-sized avatar

Guillaume Bourrousse bourroush

View GitHub Profile
- @title = "About Us"
- @description = "The Team Behind the Platform"
%div.l-wrap--bgImage.p-about-wrap--top.l-wrap--hero
.l-wrap-image.l-wrap-image--tall{:data => {'stellar-ratio' => parallax_ratio}}
= render 'about_hero'
%div.l-wrap
%section.m-sec--white
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www.)?la-bague-o.com$ [NC]
RewriteCond %{REQUEST_URI} !la-bague-o.com/ [NC]
RewriteRule ^(.*)$ /la-bague-o.com/$1 [L]
@bourroush
bourroush / _header_javascript.slim
Last active December 15, 2015 00:02
Segment.io Analytics functions
/
/ Segment.io
/
javascript:
!function(){var analytics=window.analytics=window.analytics||[];if(!analytics.initialize)if(analytics.invoked)window.console&&console.error&&console.error("Segment snippet included twice.");else{analytics.invoked=!0;analytics.methods=["trackSubmit","trackClick","trackLink","trackForm","pageview","identify","reset","group","track","ready","alias","page","once","off","on"];analytics.factory=function(t){return function(){var e=Array.prototype.slice.call(arguments);e.unshift(t);analytics.push(e);return analytics}};for(var t=0;t<analytics.methods.length;t++){var e=analytics.methods[t];analytics[e]=analytics.factory(e)}analytics.load=function(t){var e=document.createElement("script");e.type="text/javascript";e.async=!0;e.src=("https:"===document.location.protocol?"https://":"http://")+"cdn.segment.com/analytics.js/v1/"+t+"/analytics.min.js";var n=document.getElementsByTagName("script")[0];n.parentNode.insertBefore(e,n)};analytics.SNIPPET_VERSION="3.1.0";
analytics.load("#{ENV['SEGM
@bourroush
bourroush / multiply-array.js
Created February 4, 2016 14:37
Write a function that takes an array of numbers and returns the sum of each number multiplied by its position in the array.
// The final total as a global variable
var total = 0;
// This function will take an element and its index as param.
// We are just declaring the function here
function logArrayElements(element, index) {
// multipliying the index and element value
value = index * element;
// This console.log is just to see exactly what's happening in the console
#L43-48
.col-sm-5.col-sm-offset-1
a ng-href="/#!/products/{{resume.slug}}"
img.mtm.mbxxs ng-src="{{resume.thumbnail}}"
.clearfix ng-if="resume.name != ''"
.c-boldital.c-trail--alt.fl {{resume.name}}
.c-boldital.fr ng-if="resume.price != false" ${{resume.price | number: 0}}
.product-customize-button.btn.btn-border onClick="customizeBox()" or customize your box
// INSTEAD OF
//.product-customize-button.btn.btn-border onClick="customizeBox()"
// p.bold-ttu.mbf or customize your box
@bourroush
bourroush / customer.liquid
Last active August 11, 2020 17:40
Notifications - Customer Metafields
{% assign valid_keys = ['products','brands','story_prefs','bookmarks'] %}
{% assign customer = form.customer_id | get: "Customer" %}
{% assign u_customer = "Customer" | new: customer.id %}
{% assign u_customer.metafields = [] %}
{% assign customer.metafields = "Metafield" | get_all: {parent:customer} %}
{% for key in valid_keys %}
{% if form.field == key %}
{% assign c_metafield = null %}