A comedic look into Drupal 8
Presented at DrupalCamp Toronto 2013 (2013-07-13). By @mparker17 and @emarchak
| alias.df !git diff --no-prefix && git diff --staged --no-prefix | |
| alias.clear reset --hard | |
| alias.st status | |
| 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 | |
| alias.co checkout | |
| alias.con checkout -b | |
| alias.ci commit | |
| alias.br branch | |
| alias.ls branch -a |
| #!/bin/bash | |
| # current Git branch | |
| branch=$(git symbolic-ref HEAD | sed -e 's,.*/\(.*\),\1,') | |
| # v1.0.0, v1.5.2, etc. | |
| versionLabel=v$1 | |
| # establish branch and tag name variables | |
| devBranch=develop |
| <!doctype html> | |
| <!-- http://taylor.fausak.me/2015/01/27/ios-8-web-apps/ --> | |
| <html> | |
| <head> | |
| <title>iOS 8 web app</title> | |
| <!-- CONFIGURATION --> |
| <?php | |
| $result = db_select('variable', 'v') | |
| ->fields('v', array('name', 'value')) | |
| ->orderBy('name', 'ASC') | |
| ->execute() | |
| ->fetchAll(); | |
| $rows = array(); | |
| foreach ($result as $row) { |
| <?php | |
| /** | |
| * Implements hook_theme_suggestions_HOOK_alter() for node.html.twig. | |
| */ | |
| function MYTHEME_theme_suggestions_node_alter(array &$suggestions, array $variables) { | |
| // Add template suggestions based on the current view mode. | |
| $node = $variables['elements']['#node']; | |
| $suggestions[] = 'node__' . $variables['elements']['#view_mode']; | |
| $suggestions[] = 'node__' . $node->bundle() . '__' . $variables['elements']['#view_mode']; | |
| } |
| ## How to add Twig templates to your OSX Quickview | |
| ## Due to the way OSX works you have to add new declarations for a file type to an application. | |
| ## That's bc of OSX's app-based approach (as opposed to the standard file based approach in Unix!) | |
| ## So you need to pick an application to add this definition to. | |
| ## I recommend using a free app you downloaded and not something you have licensed/registered. | |
| # Find the Application in Finder, control-click it, and select "Show package contents" | |
| var gulp = require('gulp'); | |
| var gutil = require('gulp-util'); | |
| var a11y = require('a11y'); | |
| gulp.task('a11y', function() { | |
| a11y('http://furtive.co', function(err, reports) { | |
| if (err) { | |
| gutil.log(gutil.colors.red('gulp a11y error: ' + err)); | |
| return; | |
| } |
2015-01-29 Unofficial Relay FAQ
Compilation of questions and answers about Relay from React.js Conf.
Disclaimer: I work on Relay at Facebook. Relay is a complex system on which we're iterating aggressively. I'll do my best here to provide accurate, useful answers, but the details are subject to change. I may also be wrong. Feedback and additional questions are welcome.
Relay is a new framework from Facebook that provides data-fetching functionality for React applications. It was announced at React.js Conf (January 2015).
| // ========================================================= | |
| // Gulp Task: browsersync | |
| // NOTE: Using gulp v4 | |
| // Description: Sync sass, typescript, html, and browser | |
| // using external config or add modify src | |
| // npm install --save-dev browser-sync gulp-typescript gulpjs/gulp.git#4.0 gulp-load-plugins | |
| // Options: node-sass gulp-sass || gulp-ruby-sass | |
| // ========================================================= | |
| var config = require('../config.js'); | |
| var browserSync = require('browser-sync').create(); |