Skip to content

Instantly share code, notes, and snippets.

View melissamcewen's full-sized avatar

Melissa McEwen melissamcewen

View GitHub Profile
@melissamcewen
melissamcewen / SassMeister-input-HTML.html
Created October 29, 2015 20:47
Generated by SassMeister.com.
<div class="l-example">
<div class="l-example__a">A<br/>&nbsp;</div>
<div class="l-example__b">B</div>
</div>
@melissamcewen
melissamcewen / dislikeeveryone.js
Created November 2, 2015 22:51
Load the list of people you've liked on OKCupid and run this in the console to dislike all of them. Easy way to delete old likes.
jQuery(".i-star").each(
function () {
jQuery(this).click();
}
)
//just testing out command line implementation of SASSphp, a PHP implementation of Libsass
// https://github.com/sensational/sassphp
function sassprocessor_drush_command(){
$items = array();
$items['whatever'] = array(
'description' => dt('compiles using libsass via sassphp' ),
);
return $items;
@melissamcewen
melissamcewen / SassMeister-input-HTML.html
Created January 12, 2016 17:42
Generated by SassMeister.com.
<div class="main">
<div class="one container">la la la</div>
<div class="two container">la </div>
<div class="three container last">la</div>
</div>
@melissamcewen
melissamcewen / SassMeister-input.scss
Created March 10, 2016 04:11
Generated by SassMeister.com.
// ----
// Sass (v3.4.21)
// Compass (v1.0.3)
// ----
@import "singularitygs";
$yellow: #b58900;
@melissamcewen
melissamcewen / migration.inc
Created May 16, 2016 00:30
Sample Migration from Body Field to Paragraph Entitys
<?php
abstract class TestMigration extends Migration {
public function __construct($arguments) {
parent::__construct($arguments);
$this->issuePattern = 'https://www.drupal.org/node/2539244:';
$this->team = array(
@melissamcewen
melissamcewen / drop_horrible_field_deploy
Created May 17, 2016 19:59
Dropping a bad field when deploying in Drupal
field_cache_clear();
field_delete_instance('field_downloads');
field_delete_field('field_downloads');
field_purge_batch(1);
@melissamcewen
melissamcewen / gist:a18d6b7118b3ce09844feea3f3f5439a
Created May 20, 2016 16:25
Query a Drupal node to get array structure
$node_wrapper = entity_metadata_wrapper('node', '70');
dpm($node_wrapper->getPropertyInfo());
$query = new EntityFieldQuery();
$query->entityCondition('entity_type', 'node')
->entityCondition('entity_id', '70');
$result = $query->execute();
dpm($result);
$node = node_load('70');
$field = field_get_items('node', $node, 'body');
dpm($field);
OR
$node_wrapper = entity_metadata_wrapper('node', '70');
dpm($node_wrapper->body->value());