This file contains hidden or 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
var passport = require('passport') | |
, express = require('express') | |
, app = express(); | |
// Passport session setup. | |
passport.serializeUser(function(user, done) { | |
done(null, user); | |
}); | |
passport.deserializeUser(function(user, done) { | |
done(null, user); |
This file contains hidden or 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
var consoleLog = console.log; | |
console.log = function() { | |
consoleLog.apply(this, $.map(arguments, function(obj) { | |
return $.isPlainObject(obj) ? $.extend(true, {}, obj) : obj; | |
})); | |
} |
This file contains hidden or 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
/** | |
* Hook to register the CKEditor plugin - it would appear in the plugins list on the profile setting page. | |
*/ | |
function hook_ckeditor_plugin() { | |
return array( | |
'plugin_name' => array( | |
// Name of the plugin used to write it. | |
'name' => 'plugin_name', | |
// Description of the plugin - it would be displayed in the plugins management section of profile settings. | |
'desc' => t('Plugin description'), |
This file contains hidden or 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 MODULE_form_alter(&$form, &$form_state, $form_id) { | |
if ($form_id == 'views_exposed_filters') { | |
$form['field_date_value_year']['#attributes']['autocomplete'] = 'off'; | |
$form['field_date_value_month']['#attributes']['autocomplete'] = 'off'; | |
} | |
} |
This file contains hidden or 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 | |
/** | |
* Implements hook_form_FORM_ID_alter() for views_exposed_form. | |
*/ | |
function MODULE_form_views_exposed_form_alter(&$form, &$form_state) { | |
$form['#after_build'] = array('_MODULE_apply_js'); | |
} | |
function _MODULE_apply_js($form, &$form_state) { |
This file contains hidden or 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
diff --git a/servers/Route.bones.js b/servers/Route.bones.js | |
index b78dc77..67fc8b5 100644 | |
--- a/servers/Route.bones.js | |
+++ b/servers/Route.bones.js | |
@@ -95,7 +95,7 @@ server.prototype.loadCollection = function(req, res, next) { | |
req.collection = new this.models[name]([], req.query); | |
var options = { | |
success: function(collection, resp) { | |
- res.send(resp, headers); | |
+ res.send(resp, _.extend(_.result(model, 'headers') || {}, headers)); |
This file contains hidden or 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
/** | |
* Field handler to provide simple renderer that calls function to record | |
* radioactivity of the node being viewed. | |
*/ | |
class mcard_handler_field_node_radioactivity extends views_handler_field_node { | |
function render($values) { | |
if (module_exists('radioactivity')) { | |
radioactivity_node_user_node_view($values->nid); | |
} | |
return $this->render_link(check_plain($values->{$this->field_alias}), $values); |
This file contains hidden or 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 module_invoke_last($hook) { | |
$args = func_get_args(); | |
// Remove $hook from the arguments. | |
unset($args[0]); | |
$result = null; | |
foreach (module_implements($hook) as $module) { | |
$function = $module . '_' . $hook; | |
if (function_exists($function)) { | |
$result = call_user_func_array($function, $args); | |
} |
This file contains hidden or 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
/** | |
* Implements hook_theme(). | |
*/ | |
function HOOK_theme($existing, $type, $theme, $path) { | |
return array( | |
'h2' => array( | |
'variables' => array('text' => NULL, 'args' => NULL), | |
), | |
); | |
} |
This file contains hidden or 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
$element = array( | |
'#type' => 'markup', | |
'#markup' => t('...'), | |
'#prefix' => '<h2>', | |
'#suffix' => '</h2>' | |
); |