This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const {withAppBuildGradle} = require('@expo/config-plugins') | |
| /** | |
| * A Config Plugin to disable bundle compression in Android build.gradle. | |
| * This makes the Android app start faster - in our tests by 400ms! | |
| * @param {import('@expo/config-plugins').ConfigPlugin} config | |
| * @returns {import('@expo/config-plugins').ConfigPlugin} | |
| */ | |
| module.exports = function withNoBundleCompression(config) { | |
| return withAppBuildGradle(config, androidConfig => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function render(model){ | |
| let current_state_name = model.active_states[0].name; | |
| return $("h1", | |
| {style: {color: "darkBlue"}}, | |
| `The current state is: ${current_state_name}`); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| White Label Loyalty | |
| Rewards Service | |
| Random Event -> Ignore Event | |
| WLL User Joined Audience Event -> WLL User Joined Audience Event | |
| WLL Send Email Event -> WLL Send Email Event | |
| Bridge Service | |
| WLL User Joined Audience Event | |
| Fire subscribed webhooks -> Handle IA User Joined Audience Webhook | |
| WLL Send Email Event | |
| Fire subscribed webhooks -> Handle IA Send Email Webhook |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Filters an array of objects using custom predicates. | |
| * | |
| * @param {Array} array: the array to filter | |
| * @param {Object} filters: an object with the filter criteria | |
| * @return {Array} | |
| */ | |
| function filterArray(array, filters) { | |
| const filterKeys = Object.keys(filters); | |
| return array.filter(item => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| generate: { | |
| routes: function () { | |
| const products = api.get('products?per_page=100').then(res => { | |
| return res.data.map(product => `/product/${product.slug}`) | |
| }) | |
| const categories = api | |
| .get('products/categories?per_page=100') | |
| .then(res => { | |
| return res.data.map(category => `/category/${category.slug}`) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export const actions = { | |
| nuxtServerInit({ dispatch }, { req }) { | |
| if (process.server && process.static) return; | |
| if (!req.headers.cookie) return; | |
| const cookies = Cookie.parse(req.headers.cookie || ""); | |
| const token = cookies["access_token"] || ""; | |
| console.log(token); | |
| if (token) return dispatch("users/attempt", token); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <template> | |
| <div> | |
| <div v-if="isLoading"> | |
| <Loader /> | |
| </div> | |
| <div v-else> | |
| <div> | |
| <div> | |
| {{filters}} | |
| <div class="item__variations variation__table"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React from 'react' | |
| export default class SingleProductVariations extends React.Component { | |
| constructor (props) { | |
| super(props) | |
| this.state = { | |
| attributes: [], | |
| options: [], | |
| filters: [], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function add_cors_http_header(){ | |
| header("Access-Control-Allow-Origin: *"); | |
| header('Access-Control-Allow-Methods: GET, POST, PATCH, PUT, DELETE, OPTIONS, READ'); | |
| header('Access-Control-Allow-Headers: Origin, Content-Type, X-Auth-Token,authorization,XMLHttpRequest, user-agent, accept'); | |
| header("Access-Control-Allow-Credentials: true"); | |
| if ( 'OPTIONS' == $_SERVER['REQUEST_METHOD'] ) { | |
| status_header(200); | |
| exit(); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const sorter = { | |
| monday: 1, | |
| tuesday: 2, | |
| wednesday: 3, | |
| thursday: 4, | |
| friday: 5, | |
| saturday: 6, | |
| sunday: 7, | |
| }; |