Skip to content

Instantly share code, notes, and snippets.


Saurabh Vijayvargiya saurabh-vijayvargiya

  • Websolutions Agency
  • Zagreb, Croatia
View GitHub Profile
bdlangton /
Last active Dec 21, 2021
Drupal 8 programmatic solutions

Render custom blocks

$bid = 'myblock';
$block = \Drupal\block_content\Entity\BlockContent::load($bid);
$render = \Drupal::entityTypeManager()->getViewBuilder('block_content')->view($block);

Render plugin blocks

$block_manager = \Drupal::service('plugin.manager.block');
pfaocle /
Created Mar 8, 2016
Generate Drupal 8 hash salt
drush eval "var_dump(Drupal\Component\Utility\Crypt::randomBytesBase64(55))"
St0iK / commerce.php
Last active Aug 27, 2019
Useful Drupal Commerce line item wrapper methods & properties
View commerce.php
$wrapper = entity_metadata_wrapper('commerce_order', $order);
// if(isset($wrapper->commerce_customer_shipping->commerce_customer_address)){
// order total object
$order_total = $order_wrapper->commerce_order_total->value();
// subtotal without vat
AkshayKalose /
Last active Mar 10, 2020
Drupal 8 - Ajax Example
name: 'Ajax Example'
description: 'Just an Ajax Example'
core: 8.x
type: module
stormchasing / Auto Check-In to Southwest Flights.user.js
Last active Dec 29, 2021
Auto Check-In to Southwest Flights.user.js
View Auto Check-In to Southwest Flights.user.js
// ==UserScript==
// @name Auto Check-In to Southwest Flights
// @namespace
// @version 1.8
// @author Nicholas Buroojy (
// @contributor Ryan Izzo (
// @contributor JR Hehnly ( @stormchasing)
// @contributor Trevor McClellan (
// @description Automatically check in to Southwest Airline flights at the appropriate time.
// @include*
View 1-highcharts-cheatsheet.js
// Highcharts CheatSheet Part 1.
// Create interactive charts easily for your web projects.
// Download:
// More:
// 1. Installation.
// Highcharts requires two files to run, highcharts.js and either jQuery, MooTools or Prototype or the Highcharts Standalone Framework which are used for some common JavaScript tasks.
// <script src=""></script>
// <script src=""></script>
grenade /
Last active Jan 14, 2022
generate ed25519 ssh and gpg/pgp keys and set file permissions for ssh keys and config
# generate new personal ed25519 ssh key
ssh-keygen -o -a 100 -t ed25519 -f ~/.ssh/id_ed25519 -C "rob thijssen <>"
# generate new host cert authority (host_ca) ed25519 ssh key
# used for signing host keys and creating host certs
ssh-keygen -t ed25519 -f manta_host_ca -C
eval "$(ssh-agent -s)"