This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @file | |
* Contains Drupal\mymodule\Plugin\Block\ImageRenderExampleBlock. | |
*/ | |
namespace Drupal\mymodule\Plugin\Block; | |
use Drupal\Core\Block\BlockBase; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @file | |
* Contains Drupal\mymodule\Plugin\Block\ImageRenderExampleBlockByURI. | |
*/ | |
namespace Drupal\mymodule\Plugin\Block; | |
use Drupal\Core\Block\BlockBase; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @file | |
* Contains Drupal\mymodule\Plugin\Block\ImageRenderExampleBlockResponsive. | |
*/ | |
namespace Drupal\mymodule\Plugin\Block; | |
use Drupal\Core\Block\BlockBase; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Drop old DB | |
mysql -uroot -e "DROP DATABASE drupal8" | |
# Create new DB | |
mysqladmin -uroot create drupal8 | |
# Add permissions | |
mysql -uroot -e "GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER ON drupal8.* TO 'drupal8'@'localhost' IDENTIFIED BY 'password'" | |
# Tidy up site files |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Taxonomy terms: | |
- https://gist.github.com/facine/35bb291811c146b6fc9e#file-create_taxonomy_term-php | |
# Menu links: | |
- https://gist.github.com/facine/35bb291811c146b6fc9e#file-create_menu_link-php | |
# File items: | |
- https://gist.github.com/facine/35bb291811c146b6fc9e#file-create_file-php | |
# Nodes: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
actions_actions_map is no longer in D8. | |
actions_delete is no longer in D8. | |
actions_do is no longer in D8. | |
actions_function_lookup is no longer in D8. | |
actions_get_all_actions is no longer in D8. | |
actions_list is no longer in D8. | |
actions_load is no longer in D8. | |
actions_save is no longer in D8. | |
actions_synchronize is no longer in D8. | |
aggregator_admin_form is no longer in D8. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//events - a super-basic Javascript (publish subscribe) pattern | |
var events = { | |
events: {}, | |
on: function (eventName, fn) { | |
this.events[eventName] = this.events[eventName] || []; | |
this.events[eventName].push(fn); | |
}, | |
off: function(eventName, fn) { | |
if (this.events[eventName]) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pkill -f "Jitouch" | |
sleep 5 | |
nohup ~/Library/PreferencePanes/Jitouch.prefPane/Contents/Resources/Jitouch.app/Contents/MacOS/Jitouch > /dev/null 2>&1 & |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// http://davidwalsh.name/function-debounce | |
// Returns a function, that, as long as it continues to be invoked, will not | |
// be triggered. The function will be called after it stops being called for | |
// N milliseconds. If `immediate` is passed, trigger the function on the | |
// leading edge, instead of the trailing. | |
function debounce(func, wait, immediate) { | |
var timeout; | |
return function() { | |
var context = this, args = arguments; | |
var later = function() { |