Skip to content

Instantly share code, notes, and snippets.

{
"MRData": {
"xmlns": "http://ergast.com/mrd/1.4",
"series": "f1",
"url": "http://ergast.com/api/f1/2018/circuits.json",
"limit": "30",
"offset": "0",
"total": "21",
"CircuitTable": {
"season": "2018",
@mirie
mirie / p2_drupal_pr_template.md
Last active January 15, 2017 16:08
Simplified PR Template Draft (Drupal project)

Addresses Ticket(s):

URL to ticket(s):

Overview of work completed:

How Should this be Manually Tested?

@mirie
mirie / Drupal\file_entity\Entity\FileEntity.php
Created October 10, 2016 17:29
postSave() of FileEntity
/**
* Implements hook_file_insert().
*/
public function postSave(EntityStorageInterface $storage, $update = TRUE) {
parent::postSave($storage, $update);
// Save file metadata.
if (!empty($this->metadata)) {
if ($update) {
db_delete('file_metadata')->condition('fid', $this->id())->execute();
}
@mirie
mirie / AwsCacheAdapter.php
Created September 22, 2016 00:20
flysystem classes
<?php
namespace Drupal\flysystem_s3;
use Aws\CacheInterface;
use Drupal\Core\Cache\CacheBackendInterface;
/**
* A Drupal cache adapter for use with the AWS PHP SDK.
*/
@mirie
mirie / myModuleServiceProvider.php
Created September 7, 2016 21:02
Example: D8 - Remove a service definition. Put in src directory of a module.
<?php
namespace Drupal\myModule;
use Drupal\Core\DependencyInjection\ContainerBuilder;
use Drupal\Core\DependencyInjection\ServiceProviderBase;
/**
* Removes the internationalization service definitions from twig_extension.
*/
@mirie
mirie / p2_drupal_pr_template.md
Last active August 10, 2016 15:04
P2 PR Template Draft (Drupal Project)

Definition of Done:

This section is for your verification before submitting a PR. Remove this before submitting:

  • Has any required automated testing been written/updated?
  • Has the documentation been added/updated?
  • Is there appropriate logging included?
  • Does this add new modules/themes? If so:
    • Has the make file been updated?
    • Has the install profile's info file been updated?
    • Have you run a test build locally to confirm your new modules/themes get downloaded and enabled properly?
  • Does this add new configuration? If so:
@mirie
mirie / pr_template.md
Last active August 15, 2016 19:17 — forked from crittermike/pr_template.md
Pull request template

Erase this section when you submit a PR. This is your checklist:

Definition of Done:

  • DID YOU RUN GRUNT VALIDATE?!?!?!
  • Has this passed the Definition of Done/Completeness -- tech approach signoff, screenshot signoff, etc.
  • Has any required automated testing been written/updated?
  • Has the documentation been added/updated?
  • Is there appropriate logging included?
  • Does this add new modules/themes? If so:
    • Has the make file been updated?
  • Has moduleList been updated?
@mirie
mirie / gist:0176ce6c09dc37cd4751
Created March 18, 2016 18:58
delete all merged branches
git branch --merged | grep -v "\*" | xargs -n 1 git branch -d
@mirie
mirie / 0_reuse_code.js
Created January 18, 2016 17:55
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@mirie
mirie / index.html
Created October 14, 2015 02:43 — forked from anonymous/index.html
Do Now Activity Do Now Activity // source http://jsbin.com/voziwun
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="Do Now Activity" />
<meta charset=utf-8 />
<title>Do Now Activity</title>
<style id="jsbin-css">
/* Add your CSS! */
.challenge1 {