Skip to content

Instantly share code, notes, and snippets.

@EvanAgee
EvanAgee / Editors.feature
Created May 6, 2014 17:15
Example Behat feature for testing Drupal node creation
# https://gist.github.com/jhedstrom/5708233
Feature: Editor Tests
As a Conference Manager
I should be able to create a Node of type Session
@javascript @api
Scenario: Make sure Conference Manager can create Session
Given I am logged in as a user with the "Conference Manager" role
When I visit "node/add/session"
@waako
waako / domains.sh
Last active March 19, 2023 03:37
Lookup A-record and Nameservers for a list of domains in a txt file, output into a csv file
#!/bin/bash
# Put all the domain names in domains.txt, one per line
# then run in the terminal: bash domains.sh
# this will print each domain in the terminal as it looks it up
# The result csv will contains the domain, IP & Nameservers in each column
# Give each column the relevant header titles
echo "Domain Name,IP Address,Nameserver,Nameserver,Nameserver,Nameserver,Nameserver" > domains.csv
while read domain
@Ianfeather
Ianfeather / gist:94a5e0b36521a95c2245
Created May 2, 2014 13:40
Colour ordering and proximity
require ['jquery'], ($) ->
$(".js-colours .js-select").on "change", (e) ->
sortBy(@value)
$(".js-colours .styleguide-proximity__input").on "keyup", (event) ->
return resetProximity() if (!event.target.value)
event.keyCode is 13 and matchProximity()
sortBy = (comparator) ->
sections = document.querySelectorAll(".styleguide-block")
<?php
/**
* @file
* menu-link.func.php
*/
/**
* Overrides theme_menu_link().
*/
function bootstrap_theme_menu_link(array $variables) {
@waako
waako / regex
Created March 31, 2014 18:23
swap out less for sass
1. replace @ with $
Find: @
Replace: $
2. replace mixins
Find: \.([\w\-]*)\s*\((.*)\)\s*\{
Replace: @mixin \1\(\2\)\n{
3. replace includes
Find: \.([\w\-]*\(.*\)\s*;)
<?php
/**
* Implements hook_preprocess_HOOK().
*
*/
function MYTHEME_preprocess_html(&$vars) {
// Fixes page titles for login, register & password.
switch (current_path()) {
case 'user':
$vars['head_title_array']['title'] = t('Login');
@waako
waako / node--type--teaser.tpl.php
Created March 11, 2014 08:45
Content type Teaser node template
function hamilton_trust_preprocess_node(&$variables) {
$variables['theme_hook_suggestions'][] = 'node__' . $variables['type'] . '__' . $variables['view_mode'];
}
@hofmannsven
hofmannsven / README.md
Last active December 13, 2025 12:05
Raspberry Pi Cheatsheet
@elliotttf
elliotttf / theme_it_once.info
Last active August 29, 2015 13:56
Example source for "theme it once" blog post.
name = Theme it Once Example
description = Example of sharing markup with a front-end and back-end template engine in Drupal.
core = 7.x
@inlikealion
inlikealion / color-vars--example.scss
Created February 12, 2014 18:53
Sass color palette function from Erskine:
// http://codepen.io/erskine/pen/wLclB
// config
$_color-base-grey: rgb(229,231,234);
$palettes: (
purple: (
base: rgb(42,40,80),
light: rgb(51,46,140),
dark: rgb(40,38,65)
),
grey: (