Skip to content

Instantly share code, notes, and snippets.

View WBarton's full-sized avatar

Will Barton WBarton

View GitHub Profile

gyp ERR! configure error

When installing a module that requires Python as a dependency it is common to get the error below on a Windows machine.

> MODULE@0.0.0 install C:...\...\node_modules\MODULE
> node-gyp configure build


C:...\...\node_modules\MODULE>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" configure build )  else (node "C:\Program

Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" configure build )

^(((+44\s?\d{4}|(?0\d{4})?)\s?\d{3}\s?\d{3})|((+44\s?\d{3}|(?0\d{3})?)\s?\d{3}\s?\d{4})|((+44\s?\d{2}|(?0\d{2})?)\s?\d{4}\s?\d{4}))(\s?#(\d{4}|\d{3}))?$

([Gg][Ii][Rr] 0[Aa]{2})|((([A-Za-z][0-9]{1,2})|(([A-Za-z][A-Ha-hJ-Yj-y][0-9]{1,2})|(([AZa-z][0-9][A-Za-z])|([A-Za-z][A-Ha-hJ-Yj-y][0-9]?[A-Za-z]))))\s?[0-9][A-Za-z]{2})

+44 846 762 2537
+44 63 9746 86
+44 7496 752456
+44 20 3129 3158
+44 161 638 9068
+44 7586 678812
+44 7764 335565
+44 845 429 0068
+44 20 7946 1831
+44 844 337 3021
@WBarton
WBarton / get-rss.js
Last active February 2, 2017 23:08
Use YQL to get an RSS feed .
(function() {
'use strict';
var yqlQuery = '//query.yahooapis.com/v1/public/yql?q=select%20*%20from%20rss%20where%20url%3D';
var yqlFormat = '&format=json';
var getRss = function(url, callback, error) {
var builtUrl = yqlQuery + encodeURIComponent('"' + url + '"') + yqlFormat;
var xhr = new XMLHttpRequest();
xhr.open('GET', builtUrl);
xhr.onreadystatechange = function() {
if(xhr.readyState === 4 && xhr.status === 200) {
@WBarton
WBarton / disable-yoast-notification.php
Created June 7, 2016 09:34
Disable 'Yoast has updated...' message. Add this to themes function.php
if ( class_exists( 'Yoast_Notification_Center' ) ) {
remove_action( 'admin_notices', array( Yoast_Notification_Center::get(), 'display_notifications' ) );
remove_action( 'all_admin_notices', array( Yoast_Notification_Center::get(), 'display_notifications' ) );
}
@WBarton
WBarton / SagePay Test Card Details
Last active May 11, 2018 13:45
Test credit / debit card details used to test that the payment gateway is working saved for easy reference.
Card Type Card Number Expiry Issue CV2 Addr1 Postcode
Visa 4929000000006 12/15 na 123 88 TE4 12ST
Visa Delta 4462000000000003 12/15 na 123 88 TE4 12ST
Visa Electron UK Debit 4917300000000008 12/15 na 123 88 TE4 12ST
Mastercard 5404000000000001 12/15 na 123 88 TE4 12ST
UK Maestro 5641820000000005 12/15 01 123 88 TE4 12ST
International Maestro 300000000000000004 12/15 na 123 88 TE4 12ST
Solo 6334900000000005 12/15 1 123 88 TE4 12ST
American Express 374200000000004 12/15 na 1234 88 TE4 12ST
Japan Credit Bureau 3569990000000009 12/15 na 123 88 TE4 12ST
@WBarton
WBarton / gist:4445204
Last active December 10, 2015 14:08
Rough markup to render an easy to customise select tag from a Django form.
<select name="{{ field.auto_id }}" id="{{ field.auto_id }}">
{% for choice in form.my_choice_field.field.choices %}
<option value="{{ choice.0 }}">{{ choice.1 }}</option>
{% endfor %}
</select>