Skip to content

Instantly share code, notes, and snippets.

View gist:2114549
$(document).ready(function(){
$(".option_item").click(function (e) {
if (e.target.tagName != 'INPUT') {
$(this).find("input").toggleCheckbox();
return false;
}
});
});
View gist:3090527
/**
* Revert specified features.
*/
function cw_core_features_revert($modules) {
module_load_include('inc', 'features', 'features.export');
features_include();
foreach ($modules as $module) {
if (($feature = feature_load($module, TRUE)) && module_exists($module)) {
$components = array();
// Forcefully revert all components of a feature.
View gist:4147055
core = 7.x
api=2
; Include SAC Platform makefile
includes[] = https://github.com/stoneacre/sac_platform/blob/7.x-3.x/sac_platform.make
View gist:4539540
diff --git a/commerce_realex.module b/commerce_realex.module
index e1b86a0..407d143 100644
--- a/commerce_realex.module
+++ b/commerce_realex.module
@@ -156,11 +156,12 @@ function _commerce_realex_supported_card_types() {
*/
class RealexParser {
- // Initialise variables.
- var $parser;
View gist:7775884
## CONFIG ---
# Some variables to make our life easier.
# These are sourced in from a local config file so that we can keep them out of git.
# PANTHEON_SITE_NAME='X'
# PANTHEON_USERNAME='X'
# PANTHEON_PASSWORD='X'
# PANTHEON_SITE_USERNAME='X'
# PANTHEON_SITE_PASSWORD='X'
# TEST_SUITE_FILE='X'#
#
View gist:edbf31ed2d7ab6a753f6
diff --git a/modules/pantheon/pantheon_apachesolr/pantheon_apachesolr.module b/modules/pantheon/pantheon_apachesolr/pantheon_apachesolr.module
index e3e732c..97bd383 100644
--- a/modules/pantheon/pantheon_apachesolr/pantheon_apachesolr.module
+++ b/modules/pantheon/pantheon_apachesolr/pantheon_apachesolr.module
@@ -72,6 +72,18 @@ function pantheon_apachesolr_help($path, $arg) {
}
/**
+ * Implemenets hook_permission().
+ */
View gist:c28f6c54735628b20f81
diff --git a/lib/esConnector.js b/lib/esConnector.js
index 99318ac..3aa48db 100644
--- a/lib/esConnector.js
+++ b/lib/esConnector.js
@@ -175,19 +175,20 @@ ESConnector.prototype.setupMappings = function (modelNames, callback) {
return !modelNames || _.includes(modelNames, mapping.name);
});
log('ESConnector.prototype.setupMappings', 'mappingsToSetUp', _.pluck(mappingsToSetUp, 'name'));
-
Promise.map(
@mrfelton
mrfelton / resthook.js
Created Jun 29, 2016
Example fullcube webhook client implementation
View resthook.js
const bodyParser = require('body-parser')
const crypto = require('crypto')
const logger = require('fullcube-logger')
module.exports = function resthookBootFn(app) {
/**
* Calculate a secret token based on the payload and the shared secret
* @param secret
* @param payload
* @returns {*}
View gist:425337282a3b2734630be4d4ae03fa28
process.env.GRPC_SSL_CIPHER_SUITES =
"ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384";
var grpc = require("grpc");
var fs = require("fs");
const lndCert = fs.readFileSync("/home/bitcoin/.lnd/tls.cert");
const credentials = grpc.credentials.createSsl(lndCert);
const lnrpcDescriptor = grpc.load("rpc.proto");