Each day at our company, developers are required to document their activities, painstakingly jotting down their daily work and future plans. A monotonous chore that I just really dislike.
So now, there's a scribe for that :
import fs from 'fs'; | |
import path from 'path'; | |
function getCompName(filePath) { | |
const fileName = filePath.split('.')[0] | |
const componentName = fileName.replace(/\[|\]/g, '') | |
.split('/') | |
.filter(part => part !== 'routes') | |
.map(part => part.charAt(0).toUpperCase() + part.slice(1)) | |
.join(''); |
type Path<T, Key extends keyof any = keyof T> = Key extends keyof T | |
? T[Key] extends object | |
? T[Key] extends infer R | |
? `${Key & string}.${Path<R, keyof R>}` | `${Key & string}` | |
: never | |
: `${Key & string}` | |
: never; | |
type Paths<T> = Path<T> extends string ? Path<T> : never; | |
function translation<T, P extends Paths<T>>( |
Each day at our company, developers are required to document their activities, painstakingly jotting down their daily work and future plans. A monotonous chore that I just really dislike.
So now, there's a scribe for that :
from openpyxl import load_workbook | |
wb = load_workbook('template.xlsx') | |
# grab the active worksheet | |
ws = wb.active | |
# Data can be assigned directly to cells | |
ws['A2'] = 'Tom' | |
ws['B2'] = 30 |
Docker 23 + Traefik v2.9.10 and v1.7 + Let's Encrypt + Github Registry V2 ghcr.io + Updated on 12 April 2023 | |
Content: | |
- Ubuntu 22.04 | |
- Docker Engine 23.0.3 | |
- Docker Compose 2.17.2 | |
- Traefik v1.7.18 with dnsChallenge | |
- Traefik v2.9.9 with httpChallenge | |
-- | |
- Github Registry V2 ghcr.io |
import * as React from 'react' | |
const originalSetItem = localStorage.setItem | |
localStorage.setItem = function() { | |
const event = new Event('storageChange') | |
document.dispatchEvent(event) | |
originalSetItem.apply(this, arguments) | |
} | |
const originalRemoveItem = localStorage.removeItem | |
localStorage.removeItem = function() { |
//Extract fragment of code into its own function named after its purpose. | |
function printOwing(invoice) { | |
printBanner() | |
let outstanding = calculateOutstanding() | |
// print details | |
console.log(`name: ${invoice.customer}`) | |
console.log(`amount: ${outstanding}`) | |
} |
These are the rough steps for getting a surrealdb instance running on fly.io and connecting to it. This is heavily based off of steps posted in the surrealdb discord by rvdende. View Origional Post.
These steps work just fine for the hobby (pay as you go) plan.
HEADS UP By default this will create an instance on a single shared cpu with 256m memory. This is pretty darn small to do anything but experiment, but its free. You can scale your instance to something more useable by visiting the https://fly.io/apps/<appname>/scale
. Obviously scaling to larger instances will incur higher costs, please refer to fly.io pricing
source: fly.io docs
#Monad
In Haskell, type classes are defined using the class keyword, followed by the name of the type class and the methods it defines. For example, here's how you might define a type class for types that can be compared for equality:
class Object | |
def true? | |
return unless self | |
tmp = yield | |
return tmp | |
end | |
def else | |
return yield unless self | |
self |