Skip to content

Instantly share code, notes, and snippets.

View avblink's full-sized avatar

Alexander Benjamin avblink

View GitHub Profile
@avblink
avblink / vue2-nuxt.md
Last active July 11, 2017 08:08
Vue and Nuxt related snippets

Add sass loader

npm install node-sass sass-loader --save-dev

NUXT simultaneous asynchronous data request

async asyncData({ params }) {
  let [users, posts] = await Promise.all([
 axios.get('http://jsonplaceholder.typicode.com/users'),
@avblink
avblink / SEO:Crawling:UrlTitle
Last active July 6, 2017 16:14
SEO:Crawling:Get URL & Page Title
#!/bin/bash
#Domain name without trailing slash please
domain='http://local.vwt'
directories=(
'/markets'
'/applications'
'/technologies'
'/products'
@avblink
avblink / Drupal8:Webforms:Ajax
Created May 1, 2017 17:10
Submit Drupal 8 webform via AJAX
<?php
function my_module_webform_submission_form_alter(array &$form, FormStateInterface $form_state, $form_id) {
if ($form['#webform_id'] == 'contact_an_expert') {
#$form['actions']['submit']['#validate'][] = 'wmp_content_types_contact_an_expert_form_validate';
$form['actions']['submit']['#ajax'] = [
'callback' => 'my_module_contact_an_expert_form_ajax',
'wrapper' => '.field--name-dynamic-block-fieldnode-contact-an-expert-form',
'type' => 'throbber',