Skip to content

Instantly share code, notes, and snippets.

View sudomaxime's full-sized avatar

Maxime Nadeau sudomaxime

View GitHub Profile
// Margin
.m{
//Left
&-l{
&5 {margin-left: 5px}
&10 {margin-left: 10px}
&15 {margin-left: 15px}
&20 {margin-left: 20px}
&25 {margin-left: 25px}
@sudomaxime
sudomaxime / snip-cookie-watcher.js
Last active September 12, 2017 18:14
Simple class to refresh Snipcart cookie ID after a certain amount of days, can be useful if you have order configurations that changes often.
@sudomaxime
sudomaxime / download-hack.js
Created February 26, 2018 19:53
Force a file download
function SaveToDisk(fileURL, fileName) {
// for non-IE
if (!window.ActiveXObject) {
var save = document.createElement('a');
save.href = fileURL;
save.target = '_blank';
save.download = fileName || 'unknown';
var evt = new MouseEvent('click', {
'view': window,
// Variables
//
// Variables should follow the `$component-state-property-size` formula for
// consistent naming. Ex: $nav-link-disabled-color and $modal-content-box-shadow-xs.
//
// Color system
//
@sudomaxime
sudomaxime / wysiwyg.html
Created November 6, 2018 15:37
Gallery shortcode
<div class="wysiwyg-gallery">
<div class="row">
<div class="col-4">
<div class="wysiwyg-gallery-item">
<div class="wysiwyg-gallery-image">
<div class="wysiwyg-gallery-zoom">
<i class="zoom-icon fas fa-search-plus text-white"></i>
</div>
<a href="http://via.placeholder.com/1200x768" data-toggle="lightbox" data-gallery="gallery-name" data-type="image">
[
{
id: '2',
dateSpanBegin: fakeDates.startOfNextWeek,
days: [
{
date: fakeDates.startOfNextWeek,
dayOfWeek: 0,
choices: [
{
// fonts.scss
@import url('https://fonts.googleapis.com/css?family=Oswald:400,700|Roboto:400,700');
$fontDisplay: 'Oswald', sans-serif;
$fontText: 'Roboto', sans-serif;
h1, h2, h3, h4, h5, h6 {
font-family: $fontDisplay;
}
function setCookie(name,value,days) {
var expires = "";
if (days) {
var date = new Date();
date.setTime(date.getTime() + (days*24*60*60*1000));
expires = "; expires=" + date.toUTCString();
}
document.cookie = name + "=" + (value || "") + expires + "; path=/";
}
function getCookie(name) {
{% extends "base.twig" %}
{% block content %}
{# Titre de la page -------------------------------------------------------- #}
<div class="row">
<div class="col">
<h2 class="d-block d-md-inline">{{post.post_title}}</h2>
</div>
</div>
feilds : Page / docs
<?php
namespace Adapt\Fields;
function make_doc () {
$category = array(
'name' => 'category_doc',