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
=IF(OR(LEFT(A1,3)="MR ",LEFT(A1,4)="MRS ",LEFT(A1,3)="DR "),RIGHT(A1,LEN(A1)-FIND(" ",A1)),A1) |
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
<system.webServer> | |
<!-- paste the following before the </system.webServer> closing tag --> | |
<rewrite> | |
<rules> | |
<rule name="UsePrettyUrls" stopProcessing="true"> | |
<match url="^news/([^/]+)/?$" /> | |
<conditions> | |
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /> | |
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" /> | |
</conditions> |
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 findCounty(postcode) { | |
var response = UrlFetchApp.fetch('api.postcodes.io/postcodes/' + postcode); | |
var resJson = JSON.parse(response.getContentText()) | |
return resJson.result['admin_county']; | |
} | |
function findCountyAlt(postcode) { | |
var response = UrlFetchApp.fetch('api.postcodes.io/postcodes/' + postcode); | |
var resJson = JSON.parse(response.getContentText()) | |
return resJson.result['primary_care_trust']; |
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
export default class Calculator { | |
constructor() { | |
this.value = 0; | |
} | |
revenue(value) { | |
this.value = value; | |
return this; | |
} |
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
const pipe = (...fns) => arg => fns.reduce((value, fn) => fn(value), arg); | |
const calculateProfit = pipe( | |
// Deduct EU VAT (0.20) | |
value => value * (1 - 0.2), | |
// Deduct corporation tax (0.20) | |
value => value * (1 - 0.2), | |
// Add external contributions |