$node = \Drupal::routeMatch()->getParameter('node');
if ($node instanceof \Drupal\node\NodeInterface) {
$nid = $node->id();
}
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
#!/usr/bin/php -q | |
<?php | |
/* | |
Ampp3d - Ampp3d Google Analytics | |
Version: 0.1 | |
Author: William Turrell | |
Author URI: wturrell.co.uk | |
Description: Use Google Analytics API to retrieve most popular pages and construct an HTML fragment we can use | |
Adapted from http://www.techpunch.co.uk/development/oauth2-google-analytics-api-service-account-php and | |
https://github.com/lobsterdore/analytics-api-oauth2-example/blob/master/mostPopularContentExample.php |
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
'use strict'; | |
// Generated on 2014-04-14 using generator-leaflet 0.0.14 | |
var gulp = require('gulp'); | |
var open = require('open'); | |
var wiredep = require('wiredep').stream; | |
// Load plugins | |
var $ = require('gulp-load-plugins')(); |
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
parse_git_branch() { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/' | |
} | |
export PS1="\[\033[1;32m\]❎ DATE:\[\033[1;37m\] \d \[\033[1;32m\] ❎ USER:\[\033[1;37m\] \u \[\033[32m\] ❎ DIRECTORY:\[\033[1;37m\] \w \[\033[1;32m\] ❎ BRANCH:\[\033[1;37m\]\$(parse_git_branch)\[\033[00m\] \n\[\033[1;32m\]└ ▶ \[\033[37m\]" | |
GIT COLOR | |
#[alias] | |
# lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative |
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
<header> | |
<h1>SITE TITLE</h1> | |
<nav> | |
<ul> | |
<li><a href="#">HOME</a></li> | |
<li><a href="#">ABOUT</a></li> | |
<li><a href="#">SERVICES</a></li> | |
<li><a href="#">CONTACT</a></li> | |
</ul> | |
</nav> |
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
/// Configuration for using `package:build`-compatible build systems. | |
/// | |
/// See: | |
/// * [build_runner](https://pub.dev/packages/build_runner) | |
/// | |
/// This library is **not** intended to be imported by typical end-users unless | |
/// you are creating a custom compilation pipeline. See documentation for | |
/// details, and `build.yaml` for how these builders are configured by default. | |
import 'package:build/build.dart'; |