Skip to content

Instantly share code, notes, and snippets.

@webchick
webchick / gist:1e937cbe8d5cc698aa00
Last active July 11, 2017 18:46
Google BigQuery queries for Drupal GitHub data
# See: http://www.githubarchive.org / https://github.com/igrigorik/githubarchive.org/tree/master/bigquery
# Drupal-ish repos on GitHub: 10,491
SELECT repository_url, LEFT(repository_created_at, 7) AS month
FROM [githubarchive:github.timeline]
WHERE type = 'CreateEvent'
AND (repository_name CONTAINS 'drupal'
OR repository_description CONTAINS 'drupal')
GROUP BY repository_url, month
ORDER BY month DESC
@webchick
webchick / gist:85e02f6c2f96d38f6c0a
Last active September 25, 2015 14:40
I <3 (3)DS

(3)DS is the best system EVER! I love it soooo much. Here are some of my favourite games and why.

Note: Check out http://www.metacritic.com/browse/games/release-date/available/3ds/metascore and http://www.metacritic.com/browse/games/release-date/available/ds/metascore as well. You might have more variety in your game choices than I do, and there are lots of other games rated in the 80s+.

ACTION / ADVENTURE

  • The Legend of Zelda: A Link Between Worlds: This game is sooooo good. Totally reminds me of SNES-style Zelda, and unlike most of the O&@#ing Zelda games on 3DS / DS, this one is an original game and not a remake.
  • Various DS Castlevania games (not the 3DS one! That one SUCKS!): Horror / exploration. You're in an enormous castle and need to find your way around, but certain paths are blocked off to you until you beat bosses and then obtain a new power like, say, the ability to slide into narrow passages. If you ever played Super Metroid or Super Castlevania on SNES, that's
@webchick
webchick / guzzle.php
Created August 23, 2014 05:58
8-line Guzzle script to read D8 REST API
<?php
require_once __DIR__ . '/core/vendor/autoload.php';
use GuzzleHttp\Client;
$client = new Client();
$response = $client->get('http://example.com/node/1', array(
'headers' => array('Accept' => 'application/hal+json')
));
print_r($response->json());
@webchick
webchick / gist:956a2d7a49c7490fefb5
Last active December 3, 2019 09:25
Most popular D7 modules (as of July 16, 2015)
SELECT n.title, SUM(w.count) as total
FROM project_usage_week_release w
INNER JOIN field_data_field_release_project r ON w.nid = r.entity_id
INNER JOIN node n ON n.nid = r.field_release_project_target_id
INNER JOIN
field_data_field_release_version v ON v.entity_id = r.entity_id
WHERE LEFT(v.field_release_version_value, 3) = '7.x'
AND FROM_UNIXTIME(w.timestamp) BETWEEN CURDATE()-INTERVAL 2 WEEK AND CURDATE()
GROUP BY n.title
ORDER BY total DESC;
@webchick
webchick / gist:11268260
Last active August 29, 2015 14:00
D6 support length issue
https://drupal.org/node/2136029
Our current policy is to stop security supporting Drupal X when Drupal (X+2) is released. In other words, stop security supporting D6 when 8.0.0 is released. Which means, if the day after 8.0.0 is released, a security vulnerability is discovered in D7 and/or D8, an SA that discloses that vulnerability publicly can be made once it is fixed for those versions, even if the same vulnerability also exists in D6. Which potentially puts sites running D6 at high risk.
The <a href="https://groups.drupal.org/imp">Import API in Drupal 8 core</a> team is working hard to support a direct D6 to D8 migration path (the initial patch was just committed). However, in practice, few sites will be able to migrate their D6 site to 8.0 the day that it's released. It'll take some time for contrib modules to be ready on D8. With D6 and D7, it took over a year from the core release for some of the most popular modules to get ported and released. Some of that time can be attributed to waiting on Views,
/**
* Provides a base class for single- and multistep view forms. It only
* dispatches logic to the form for the current step.
* The form is always assumed to be multistep, even if it has only one
* step (which by default is \Drupal\views\Form\ViewsFormMainForm). That way it
* is actually possible for modules to have a multistep form if they need to.
*/
@webchick
webchick / gist:6912890
Last active December 25, 2015 03:49
Remove the +s
<?php
/**
* @file
* Contains \Drupal\config\Tests\ConfigExportImportUITest.
*/
namespace Drupal\config\Tests;
use Drupal\simpletest\WebTestBase;
-<?php
-
-/**
- * @file
- * Contains \Drupal\menu_test\Plugin\Menu\LocalTask\TestTasksView.
- */
-
-namespace Drupal\menu_test\Plugin\Menu\LocalTask;
-
-use Drupal\Core\Menu\LocalTaskBase;
@webchick
webchick / gist:6471373
Last active December 22, 2015 12:18
SQL Queries to determine d.o brainstorming participation
# 258 people in total participated.
SELECT DISTINCT u.name FROM users u
INNER JOIN node n ON u.uid = n.uid
INNER JOIN og_ancestry o ON n.nid = o.nid
WHERE
group_nid = 312008 /* Drupal.org brainstorming */
UNION
SELECT DISTINCT u.name
FROM users u
@webchick
webchick / gist:6471161
Created September 6, 2013 23:02
View to sort through d.o brainstorming results.
$view = new view;
$view->name = 'temp_do_brainstorm';
$view->description = '';
$view->tag = '';
$view->base_table = 'node';
$view->core = 6;
$view->api_version = '2';
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
$handler = $view->new_display('default', 'Defaults', 'default');
$handler->override_option('relationships', array(