Skip to content

Instantly share code, notes, and snippets.

View domtalbot's full-sized avatar

Dominic Talbot domtalbot

View GitHub Profile
(function(){"use strict";try{if(typeof document<"u"){var r=document.createElement("style");r.appendChild(document.createTextNode("input[type=text]{width:100px;padding:.375rem .75rem;border:1px solid #dee2e6;background:#fff;border-radius:.375rem;font-weight:500}select{padding:.375rem .75rem;border:1px solid #dee2e6;background:#fff;border-radius:.375rem;font-size:80%;cursor:pointer}.body{border-radius:5px;width:300px;font:14px/1.3Poppins,Segoe UI,Arial,sans-serif;box-shadow:0 .5rem 1rem #00000026!important}.body .header{padding:10px 0;background-color:#615ffd;text-align:center;border-radius:5px 5px 0 0;color:#fff}.breakdown{padding:15px;background:#615ffd;color:#fff;border-radius:0 0 5px 5px;font-size:85%;margin-top:.5rem}.section{padding:10px;color:#00000080}#lowestMonthlyPayments{text-align:center}.section a{border:1px solid black;border-radius:10px;padding:2px;background-color:gray;color:#fff;text-decoration:none}.section label{display:inline-block;width:170px;font-size:80%;font-weight:400;color:#615ffd}#pro
@domtalbot
domtalbot / fake-retailers.json
Last active May 11, 2023 14:25
Fake Retailers
[
{
"name": "Boutique Camping",
"url": "https://boutiquecamping.com/",
"category": "Lifestyle",
"image": "boutique-camping.jpg"
},
{
"name": "Furniture Outlets",
"url": "https://furnitureoutletstores.co.uk/",
@domtalbot
domtalbot / index.js
Last active October 10, 2022 13:32
payment-flow
/* API */
/**
* Fetch the available payment methods from Adyen
*
* GET: /api/payment-methods
*/
app.get('/api/payment-methods', async (req, res) => {
try {
const response = await checkout.paymentMethods({
shopperReference: req.query.userGuid,
https://vstsagentpackage.azureedge.net/agent/2.209.0/vsts-agent-osx-x64-2.209.0.tar.gz
# place this after nvm initialization!
autoload -U add-zsh-hook
load-nvmrc() {
local node_version="$(nvm version)"
local nvmrc_path="$(nvm_find_nvmrc)"
if [ -n "$nvmrc_path" ]; then
local nvmrc_node_version=$(nvm version "$(cat "${nvmrc_path}")")
if [ "$nvmrc_node_version" = "N/A" ]; then
if (event.detail.contactFormId === '5') {
var formData = {
EMAIL: ''
};
for (var i = 0; i < event.detail.inputs.length; i++) {
if (event.detail.inputs[i].name === 'your-email') {
formData.EMAIL = event.detail.inputs[i].value;
}
financeDevelopmentFunds(type: string): number {
let calcTotal = 0;
let compTotal = 0;
const seniorFixed = this.data.finance.senior.fixedSum || 0;
const seniorLTV = this.data.finance.senior.ltv || 0;
const seniorLTC = this.data.finance.senior.ltc || 0;
const seniorLTGDV = this.data.finance.senior.ltGDV || 100;
const mezzFixed = this.data.finance.mezz.fixedSum || 0;
// The base price entered by the sculpter
$base_price = $result['Sculpture'] ['price']; // 1050
// Default vat rate to 1, changing to the standard 1.2 if vat is applicable.
$vat_rate = 1;
if ($result['Sculpture']['vat'] == 1) {
$vat_rate = 1.2;
}
// Get the commission rate, stored as a number eg. 33% = 1.33
<!-- ClickGuardian.co.uk -->
<script type="text/javascript">
var _cgk = 'ao0HmV4MGWiwH';
var _cgd = 'mis-sold-solar.co.uk';
(function () {
var cg = document.createElement('script'); cg.type = 'text/javascript'; cg.async = true;
cg.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'protection.clickguardian.co.uk/cgts.js';
@domtalbot
domtalbot / control.js
Created March 21, 2018 14:32
Netlify Custom Widget
import React from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { Map } from 'immutable';
import CMS from 'netlify-cms';
export default class DynamicControl extends React.Component {
static propTypes = {
onChange: PropTypes.func.isRequired,
onAddAsset: PropTypes.func.isRequired,