Skip to content

Instantly share code, notes, and snippets.

View rachellawson's full-sized avatar

Rachel Lawson rachellawson

View GitHub Profile
const data = require('./Slack/javascript/2018-05-14.json');
const usersExport = require('./Slack/users.json');
// Load all users into memory.
const users = {};
const contributors = {};
usersExport.forEach(user => {
users[user.id] = user.profile.display_name_normalized ? user.profile.display_name_normalized : user.profile.real_name_normalized;
});
@shadcn
shadcn / ActionsNoDropButton.php
Last active August 8, 2017 09:01
Add an actions_no_dropbutton Element to render form actions without the dropbutton
<?php
namespace Drupal\et_article\Element;
use Drupal\Core\Render\Element\Actions;
/**
* Provides a wrapper element to render buttons for a form.
*
* Usage example:
* @code
id: the_content
label: Your Content Migration
migration_group: whatever_you_call_this_group
source:
plugin: your_content_source
destination:
plugin: entity:your_content_type
process:
@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();
@Luukyb
Luukyb / Vagrantfile
Created September 6, 2014 03:45
Minimal Vagrantfile for Drupal. Box + IP + Memory + File Permission
# -*- mode: ruby -*-
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.network "forwarded_port", guest: 80, host: 8080
@andymantell
andymantell / config.rb
Created September 24, 2012 15:12
Using Compass's callbacks to flush Drupal's cache when a stylesheet is re-compiled
on_stylesheet_saved do |filename|
system("drush cc css-js")
end
@jpstacey
jpstacey / .gitconfig
Last active February 7, 2024 04:35
Sample git config
# See the following for references:
# * http://www.metacircus.com/hacking/2011/02/18/play-git-like-a-violin.html
# * http://cheat.errtheblog.com/s/git/
# * http://pyrtsa.posterous.com/aligning-your-git-logs
# * http://blog.apiaxle.com/post/handy-git-tips-to-stop-you-getting-fired/
# Git >v1.7.10 lets you include external files
# Put your user configuration in here, so it never
# accidentally gets checked in
[include]