Skip to content

Instantly share code, notes, and snippets.

<?xml version="1.0"?>
<root>
<item>
<name>Remap Left Control to Hyper</name>
<appendix>OS X doesn't have a Hyper. This maps Left Control to Control + Shift + Option + Command.</appendix>
<identifier>space_cadet.left_control_to_hyper</identifier>
<autogen>
--KeyToKey--
@mikeyp
mikeyp / 0_reuse_code.js
Created April 28, 2016 14:41
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
<?php
$map = \Drupal::entityManager()->getFieldMap();
dsm($map);
@mikeyp
mikeyp / html.html.twig
Created June 16, 2015 21:08
Oh Drupal!!
{% if head_title is iterable %}
<title>{{ head_title|safe_join(' | ') }}</title>
{% else %}
<title>{{ head_title }}</title>
{% endif %}
@mikeyp
mikeyp / gist:e517bf75611f69d702e3
Created June 10, 2015 20:31
project.make.yml
core: 8.x
api: 2
defaults:
projects:
subdir: contrib
location: "http://updates.drupal.org/release-history" # Workaround for missing SSL on updates.drupal.org
# Drupal Core
projects:
include_once(/Users/MYCOWORKERSNAME/git/client-com/drupal/themes/custom/client/client.theme): failed to open stream: No such file or [warning]
directory in Drupal\Core\Extension\Extension-&gt;load() (line 145 of
core/lib/Drupal/Core/Extension/Extension.php).Drupal\Core\Extension\Extension->load()
Drupal\Core\Extension\Extension->load()
twig_init(Object)
call_user_func('twig_init', Object)
Drupal\Core\Theme\ThemeInitialization->loadActiveTheme(Object)
Drupal\Core\Theme\ThemeInitialization->initTheme('client')
Drupal\Core\Theme\ThemeManager->initTheme(NULL)
Drupal\Core\Theme\ThemeManager->getActiveTheme()
@mikeyp
mikeyp / awyiss.coffee
Created April 17, 2015 20:08
Hubot plugin
# Description:
# aw yiss
#
# Dependencies:
# None
#
# Configuration:
# None
#
# Commands:
<?php
$queue = DrupalQueue::get('versioncontrol_reposync');
while ($item = $queue->claimItem()) {
try {
versioncontrol_reposync_run_worker($item->data);
$queue->deleteItem($item);
}
catch (Exception $e) {
mikey-p ~/git/example/drupal (dev): drush cc drush --debug
Starting Drush preflight. [0.01 sec, 451.49 KB] [preflight]
Cache MISS cid: 7.0-dev-commandfiles-0-95a56dc71d69d1c02a2a6e6dd9e7ee4b [0.01 sec, 474.91 KB] [debug]
Cache SET cid: 7.0-dev-commandfiles-0-95a56dc71d69d1c02a2a6e6dd9e7ee4b [0.03 sec, 501.31 KB] [debug]
Bootstrap to phase 0. [0.17 sec, 2.73 MB] [bootstrap]
Drush bootstrap phase : bootstrap_drupal_root() [0.17 sec, 2.74 MB] [bootstrap]
Initialized Drupal 7.34 root directory at /Users/mdp/git/example/drupal [0.18 sec, 2.76 MB] [notice]
Cache MISS cid: 7.0-dev-commandf
mikey-p ~/git/projectname/drupal (dev): drush --version
Drush Version : 7.0.0-alpha9
mikey-p ~/git/projectname/drupal (dev): drush sql-conf
Array
(
[driver] => mysql
[database] => projectname
[username] => root
[host] => localhost