Combine default parameters and destructuring for a compact version of the defaults / overrides pattern.
function foo ({
bar = 'no',
baz = 'works!'
} = {}) {
$colours: | |
"red" #FF0000, | |
"blue" #001EFF, | |
"green" #00FF00, | |
"yellow" #F6FF00; | |
@each $i in $colours{ | |
.#{nth($i, 1)}-background { | |
background: nth($i, 2); | |
} |
window.addEventListener('DOMContentLoaded', function() { | |
'use strict'; | |
console.log('DOMContentLoaded, checking for NFC'); | |
if (!navigator.mozNfc) { | |
console.log('NFC not available'); | |
return; | |
} | |
navigator.mozSetMessageHandler('activity', (activity) => { |
function transfer | |
if test (count $argv) -eq 0 | |
echo "No arguments specified. Usage:\necho transfer /tmp/test.md\ncat /tmp/test.md | transfer test.md" | |
return 1 | |
end | |
## get temporarily filename, output is written to this file show progress can be showed | |
set tmpfile ( mktemp -t transferXXX ) | |
## upload stdin or file |
A lot of important government documents are created and saved in Microsoft Word (*.docx). But Microsoft Word is a proprietary format, and it's not really useful for presenting documents on the web. So, I wanted to find a way to convert a .docx file into markdown.
On a mac you can use homebrew by running the command brew install pandoc
.
<?php | |
function restore_ticket_csv_headers( $columns ) { | |
// Only meddle with the attendee csv export request | |
if ( ! isset( $_GET['attendees_csv'] ) ) return $columns; | |
// Tribe__Tickets__Tickets_Handler::instance() already owns an attendee | |
// table object but it is private and there is not currently an accessor | |
$attendees_table = new Tribe__Tickets__Attendees_Table(); |
// Input it initial amount | |
// Interest as a number, e.g. 5% is 1.05 on a yearly basis | |
// Length as number of years | |
// Name of this calculation | |
// Addition determines whether the input variable is one time or a yearly contribution | |
function compound( input, interest, length, name, addition ) { | |
var accumulated = input | |
for ( i=0; i < length; i++ ) { | |
accumulated *= interest | |
if ( addition ){ |
{"Aberdare": "Mid Glamorgan", "Aberdeen": "Aberdeenshire", "Aberdovey": "Gwynedd", "Abergavenny": "Gwent", "Abergele": "Clwyd", "Abertillery": "Gwent", "Aberystwyth": "Dyfed", "Abingdon": "Oxfordshire", "Accrington": "Lancashire", "Airdrie": "Lanarkshire", "Alcester": "Warwickshire", "Aldeburgh": "Suffolk", "Alderley Edge": "Cheshire", "Aldershot": "Hampshire", "Alfreton": "Derbyshire", "Alness": "Ross-shire", "Alnwick": "Northumberland", "Alresford": "Hampshire", "Alston": "Cumbria", "Alton": "Hampshire", "Altrincham": "Cheshire", "Ambleside": "Cumbria", "Amersham": "Buckinghamshire", "Amesbury": "Wiltshire", "Ammanford": "Carmarthenshire", "Andover": "Hampshire", "Anstruther": "Fife", "Antrim": "Co Antrim", "Appleby-in-Westmorland": "Cumbria", "Arbroath": "Angus", "Ardrossan": "Ayrshire", "Armagh": "Co Armagh", "Arthog": "Gwynedd", "Arundel": "West Sussex", "Ascot": "Berkshire", "Ashbourne": "Derbyshire", "Ashburton": "Devon", "Ashford": "Middlesex", "Ashington": "Northumberland", "Ashtead": "Surrey", "Asht |
{ | |
"name": "OpenChat 3.5", | |
"load_params": { | |
"n_ctx": 8192, | |
"n_batch": 512, | |
"rope_freq_base": 10000, | |
"rope_freq_scale": 1, | |
"n_gpu_layers": 80, | |
"use_mlock": true, | |
"main_gpu": 0, |
// Open a supplied HTML file and record whatever's going on to an MP4. | |
// | |
// Usage: node recorder.cjs <path_to_html_file> | |
// Dependencies: npm install puppeteer fluent-ffmpeg | |
// (and yes, you need ffmpeg installed) | |
// | |
// It expects a <canvas> element to be on the page as it waits for | |
// that to load in first, but you can edit the code below if you | |
// don't want that. | |
// |