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 | |
namespace Drupal\example; | |
class TarArchive extends \Barracuda\ArchiveStream\TarArchive { | |
public function add_remote_file($name, $path, $size, array $opt = array()) | |
{ | |
// send file header | |
$this->init_file_stream_transfer($name, $size, $opt); | |
// open input file |
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 | |
$type = 'my_node_type'; $nids = db_query('select nid from node where type = :type', array(':type' => $type))->fetchCol(); pathauto_node_update_alias_multiple($nids, 'bulkupdate', array('message' => TRUE)); |
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 | |
public static function getBaseQuery($view_name, $display_id, $clear_fields = false) { | |
$view = views_get_view($view_name)->copy(); | |
// Set dummy input to avoid fetching input from $_GET. | |
$view->exposed_input = array('' => ''); | |
$view->set_arguments(array()); | |
$view->set_display($display_id); | |
// Make sure the exposed form is not rendered, otherwise we end up in a |
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 | |
class MyUtils { | |
public static function getHash($string) { | |
return hash_hmac('sha256', $string, drupal_get_private_key(), false); | |
} | |
/** | |
* Helper function to encode and hash data. | |
*/ |
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
(function() { | |
function parseSelectors(rule, index) { | |
rule.selectorText.split(/, */).map(function(t) { | |
var p = /\.[A-z0-9-_]+/g, m; | |
while(m = p.exec(t)) { | |
if(!index.hasOwnProperty(m[0])) { | |
index[m[0]] = 0; | |
} | |
index[m[0]]++; | |
} |
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
license: mit |
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
license: mit |
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
license: mit | |
height: 500 | |
scrolling: yes |
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
license: mit | |
border: no | |
scrolling: yes | |
height: 500 |
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
license: mit |