Skip to content

Instantly share code, notes, and snippets.

@waako
waako / get_paragraph_type_from_field.php
Last active April 27, 2016 15:28 — forked from jenitehan/get_paragraph.php
Get paragraph type of child field item
<?php
/**
* Implements hook_preprocess_HOOK for field--field-structured-content-section.html.twig
*/
function TEMPLATE_preprocess_field__field_structured_content_section(&$variables) {
$items = $variables['items'];
foreach ($items as &$item) {
$paragraph = $item['content']['#paragraph'];
$para_type = $paragraph->getType();
This little magic will update important BOA scripts and apply the patch
to fix Drupal 7 core vulnerability: https://www.drupal.org/SA-CORE-2014-005
in all built-in D7 platforms.
Note that it will *not* fix anything in custom platforms created in the
~/static directory tree - you will have to apply this patch manually there:
https://www.drupal.org/files/issues/SA-CORE-2014-005-D7.patch
WARNING! Do not run this magic fix if you have BOA system older than 2.3.0
@JohnAlbin
JohnAlbin / SassMeister-input.scss
Created May 28, 2014 01:08
Generated by SassMeister.com.
// ----
// Sass (v3.3.7)
// Compass (v1.0.0.alpha.18)
// ----
.component,
%component {
content: 'component';
&--variant {

BOOYA - December

Bring yOur Own hYperlink Along

We're going to be trying out a new session this Thursday. Everyone brings along a link to a JS related project/post/thing, and we'll have a chat about it.

It doesn’t matter if you don’t know anything about the project, just anything that you find interesting or cool!

We'll post all the links that we discuss on jsoxford.com.

Add your links by commenting on this gist (or, if you'd rather - just come along with it on Thursday).

@kae76
kae76 / omega8cc.md
Last active December 29, 2015 13:49

[distro name] = replace with project name, e.g. openatrium would give you http://git.drupal.org/project/openatrium.git
[platform name] = replace with desired platform name based on [distro name] should not have any empty spaces
[Omega8 UID] = replace with user ID provided by Omega8.css (you will find this in the first part of your Ægir url o123456789.vXX.location.hostX.biz)

Download and build the distribution (via command line)

  1. ssh [Omega8 UID].ftp@[Omega8 UID].hostname
  2. cd ~
  3. mkdir tmp if doesn't already exist
  4. cd tmp
@waako
waako / gist:6606788
Last active December 23, 2015 08:19
bulk update user passwords via drush and a variable
# This should change the passwords for user1, user2 and user3 and set it to password
for i in user1 user2 user3; do drush upwd $i --password="password"; done
# If you need to find out all the usernames from a sequence of UIDs
for i in `seq 2 20`; do drush upwd $i; done
@meSingh
meSingh / sublime-text-installation-instructions.md
Last active June 7, 2020 16:20
Sublime Text Installation Instructions for Ubuntu 13.04 and Elementary OS Luna

Sublime Text 2 Installation Guide: Ubuntu 13.04 and Elementary OS Luna

1. Install Sublime Text 2

Open terminal

sudo add-apt-repository ppa:webupd8team/sublime-text-2
sudo apt-get update
sudo apt-get install sublime-text

2. Install Sublime Package Control

@waako
waako / Frontend united.md
Last active December 15, 2015 01:09
Frontend United London 2013

Frontend United UK 2013

13-14 April 2013 at Cargo, London - frontendunited.org

Join designers, developers, and drupalistas for two days of focused workshops, talks and sessions on design, frontend engineering and Drupal.

What is Frontend United?

Frontend United, formerly known as Drupal Design Camp, is a yearly European conference that moves from country to country, previously hosted in Prague, Berlin and Amsterdam.

<?php
/**
* Implements hook_form_alter().
To Replace the -Any- value in filters by it's label text
*/
function theme_form_alter(&$form, &$form_state, $form_id) {
kpr($form);
if ($form['#id'] == 'views-exposed-form-admin-people-block-1') {
// $my_label = 'label name';
@soulston
soulston / gist:3835190
Created October 4, 2012 17:39
Views exposed filter labels
/**
* Implements hook_form_alter().
To Replace the -Any- value in filters by it's label text
*/
function theme_form_alter(&$form, &$form_state, $form_id) {
kpr($form);
if ($form['#id'] == 'views-exposed-form-admin-people-block-1') {
// $my_label = 'label name';
foreach($form['#info'] as $key => $filter) {
if (stripos($key, 'filter-field') !== 0) {