Skip to content

Instantly share code, notes, and snippets.

View rachellawson's full-sized avatar

Rachel Lawson rachellawson

View GitHub Profile
<?php
namespace Drupal\destinations\Entity;
use Drupal\Core\Entity\EntityStorageInterface;
use Drupal\Core\Field\BaseFieldDefinition;
use Drupal\Core\Entity\RevisionableContentEntityBase;
use Drupal\Core\Entity\EntityChangedTrait;
use Drupal\Core\Entity\EntityTypeInterface;
use Drupal\user\UserInterface;
@rachellawson
rachellawson / DestinationEntity.php
Created January 6, 2017 13:29
just for NikLP - how I made the base fields
<?php
namespace Drupal\destinations\Entity;
use Drupal\Core\Entity\EntityStorageInterface;
use Drupal\Core\Field\BaseFieldDefinition;
use Drupal\Core\Entity\RevisionableContentEntityBase;
use Drupal\Core\Entity\EntityChangedTrait;
use Drupal\Core\Entity\EntityTypeInterface;
use Drupal\user\UserInterface;
@rachellawson
rachellawson / social_commentary_js_facebook-comment.js
Created November 16, 2016 16:13
Getting all that facebook comment malarkey off into a tab, that only appears when the field_facebook_comment field on the node is true.
(function ($) {
Drupal.behaviors.facebook_comment = Drupal.behaviors.facebook_comment || {
attach: function (context, settings) {
(function (d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s);
js.id = id;
js.src = "//connect.facebook.net/en_GB/sdk.js#xfbml=1&version=v2.8";
fjs.parentNode.insertBefore(js, fjs);
14:24 <timplunkett> rachel_norfolk: hi
14:24 <rachel_norfolk> timplunkett: o/
14:25 <timplunkett> rachel_norfolk: i don't like discussing things on twitter :)
14:25 <rachel_norfolk> timplunkett: I guess it has disadvantages, that's for sure :-)
14:28 <timplunkett> rachel_norfolk: so you dislike the concept of block_place? not just the execution
14:30 <timplunkett> pwolanin: timmillwood: tedbow: ^
14:30 <tedbow> rachel_norfolk: plus 1 for not discussing on twitter
14:31 <tedbow> rachel_norfolk: what don't you like about it?
14:31 <pwolanin> rachel_norfolk: timplunkett timmillwood tedbow - the concept was from Dries' keynote - I just found the fastest, lightest way to get something working
14:31 <rachel_norfolk> timplunkett: yes, the concept. Given that block placement, as an operation, creates/modifies configuration and configuration needs to be managed via git, and that management requires non-trivial understanding, the idea of creating a trivially-easy to use, yet complex to implement/support UI seems moot.
@rachellawson
rachellawson / email_obfuscator_composer.json
Created September 23, 2016 11:11
Anti spam thing text filter wotsit
{
"name": "drupal/email_obfuscator",
"type": "drupal-module",
"description": "A text filter that makes it more difficult for spambots to read email addresses.",
"keywords": ["Drupal"],
"license": "GPL-2.0+",
"homepage": "",
"minimum-stability": "dev",
"support": {
"issues": "",
uuid: b52fe4e5-ae0e-42e5-ba7e-35ffbb7cd023
langcode: en
status: true
dependencies: { }
_core:
default_config_hash: wQBGyxU9I0xkvmhVOYPTI8xAPDRmQqHJRGcumgEen0w
id: csv_migrate_story
migration_tags:
- CSV
migration_group: mt_stories
@rachellawson
rachellawson / group.html.twig
Created August 23, 2016 11:31
Rendering a member User inside a Group
<div{{ attributes }}>
{{ title_prefix }}
{% if not page %}
<h2{{ title_attributes }}>
<a href="{{ url }}" rel="bookmark">{{ label }}</a>
</h2>
{% endif %}
{{ title_suffix }}
id Title description long lat coordinates point from to
1 1667 Roosevelt Way data for this border crossing was imported -123.068239 49.001982 -123.068239,49.001982 POINT(-123.068239 49.001982) CA US
2 Peace Arch Park data for this border crossing was imported -122.75503 49.003304 -122.75503,49.003304 POINT(-122.75503 49.003304) CA US
3 111 176 St data for this border crossing was imported -122.735572 49.004631 -122.735572,49.004631 POINT(-122.735572 49.004631) CA US
4 9941 Guide Meridian Rd data for this border crossing was imported -122.484996 49.001732 -122.484996,49.001732 POINT(-122.484996 49.001732) CA US
@rachellawson
rachellawson / Bellingham-ipbill.md
Created March 12, 2016 13:09
Letter to Henry Bellingham MP on IPBill

Dear Henry Bellingham,

This is just a quick note to request your support and influence to allow more Parliamentary scrutiny for the Investigatory Powers Bill. Although views may differ on the contents of the Bill, surely everyone can agree that something as important and as complex as this deserve rigorous examination by MPs.

As the owner of a local tech company, I have looked through the Bill and several of the Codes of Practice, so I know from first-hand experience how much is contained in the 800 pages they represent in total. With only a cursory examination by MPs, it is highly likely that there will be aspects that could cause huge problems later on – for the intelligence services and police, the public, UK computer companies and specific groups like journalists, lawyers and even MPs like yourself.

It is especially pertinent to myself and my company; we work with clients and colleagues across Europe and, with my new clients, into Canada too. They have a completely reasonable expectation that we w

Keybase proof

I hereby claim:

  • I am rachellawson on github.
  • I am rachel_norfolk (https://keybase.io/rachel_norfolk) on keybase.
  • I have a public key ASBn4dX0Oc8bM6kAEltZq3TKdL8rcu_ohcmsRVuTVNHxywo

To claim this, I am signing this object: