| title | date | modified | description | art | layout | tags | ||
|---|---|---|---|---|---|---|---|---|
AI News Digest - January 2026 |
2026-01-30 |
roundup of the most notable AI developments |
monthlyai.jpg |
post.njk |
|
| title | date | modified | description | art | layout | tags | ||
|---|---|---|---|---|---|---|---|---|
Crypto News Digest - January 2026 |
2026-01-30 |
roundup of the notable Crypto developments |
monthlycrypto.jpg |
post.njk |
|
| title | date | modified | description | art | layout | tags | ||
|---|---|---|---|---|---|---|---|---|
Crypto News Digest - December 2025 |
2025-12-26 |
roundup of the most notable Crypto developments |
cryptonews-december2025.jpeg |
post.njk |
|
This file contains hidden or 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
| import NodeCache from 'node-cache'; // or 'redis' | |
| class CacheService { | |
| constructor(ttlSeconds) { | |
| // this could also be redis | |
| this.cache = new NodeCache({ stdTTL: ttlSeconds, checkperiod: ttlSeconds * 0.2, useClones: false }); | |
| } | |
| get(key, storeFunction) { |
This file contains hidden or 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 { ServiceBusClient, ReceiveMode } = require('@azure/service-bus') | |
| const connectionString = process.env['servicebus-connection'] | |
| async function send () { | |
| const sbClient = ServiceBusClient.createFromConnectionString(connectionString) | |
| const client = sbClient.createTopicClient('topic-name') | |
| const sender = client.createSender() | |
| // set label=TEST for use in subscription filter | |
| const msg = { label: 'TEST', body: { foo: 'bar', ts: new Date() } } |
This file contains hidden or 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
| import * as rp from 'request-promise-native' | |
| function convertTable (columns: any[], rows: any[]): any[] { | |
| return rows.map((row: any[]) => columns.reduce((obj, col, idx) => { | |
| obj[col.name] = row[idx] | |
| return obj | |
| }, {})) | |
| } | |
| // API reference @ https://dev.applicationinsights.io/reference |
This file contains hidden or 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
| Object.getOwnPropertyNames(Date.prototype) | |
| .filter(name => name.startsWith('to')) | |
| .map(method => `${method}: ${(new Date())[method]()}`) |
This file contains hidden or 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 numToColor (num, maxHue = 350, minHue = 0) { | |
| const hue = num * (maxHue - minHue) + minHue | |
| return `hsl(${hue}, 70%, 45%)` | |
| } |
NewerOlder