This file contains 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
// composables/useEmitter.ts | |
export default function () { | |
const hooks = useNuxtApp().hooks; | |
return { | |
emit: hooks.callHook, | |
on: hooks.hook, | |
} | |
} |
This file contains 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 triangleDown-svg-factory($fill-color) { | |
@return '<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"><path fill="' + $fill-color + '" d="M2.611 5.393c-.17-.216-.084-.393.191-.393h10.397c.275 0 .361.177.191.393l-5.08 6.464c-.17.216-.452.216-.622 0l-5.077-6.464z"/></svg>' | |
} | |
@mixin triangleDown($fillColor: rgba(#ffffff, 1), $left: center, $top: center) { | |
background: transparent url(svg-encode(triangleDown-svg-factory($fillColor))) $left $top no-repeat; | |
} | |
// Thanks to Hugo Giraudel for his str-replace function (http://www.sassmeister.com/gist/1b4f2da5527830088e4d) | |
@function str-replace($string, $search, $replace: '') { | |
$index: str-index($string, $search); |
This file contains 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
// If we get errors about mysql | |
"ln -s /Applications/MAMP/tmp/mysql/mysql.sock /tmp/mysql.sock" |
This file contains 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 fs = require("fs"); | |
const five = require("johnny-five"); | |
const board = new five.Board({ | |
port: "/dev/ttyACM0" | |
}); | |
const SerialPort = require('serialport'); | |
const Printer = require('thermalprinter'); | |
const nodeWebcam = require( "node-webcam" ); |
This file contains 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
#drush dl admin_toolbar paragraphs google_analytics weight token link_css devel entity_reference_revisions pathauto video_embed_field ctools simple_sitemap twig_tweak | |
drush dl admin_toolbar paragraphs google_analytics token link_css devel entity_reference_revisions pathauto video_embed_field ctools simple_sitemap twig_tweak draggableviews viewsreference crop focal_point linkit publishcontent cer field_group |
This file contains 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
{% for row in rows %} | |
{% set parity = cycle(['odd', 'even'], loop.index0) %} |
This file contains 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 ssh key | |
ssh-keygen -t rsa | |
// Copy public key | |
cat ~/.ssh/id_rsa.pub | |
// Apply online patch | |
curl https://www.drupal.org/files/issues/core-views_row_class_number_missing-2669394-6-D8.patch | patch -p1 | |
// SCP all files including hidden from current directory |
This file contains 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
<?php | |
use Drupal\image\Entity\ImageStyle; | |
use \Drupal\file\Entity\File; | |
function theme_preprocess_page(&$vars) { | |
if (($node = \Drupal::routeMatch()->getParameter('node')) && $node instanceof \Drupal\node\NodeInterface) { | |
// Get imagestyle url for use in Twig template |