Install the required packages:
pnpm install tsconfig-paths ts-node --save-dev
Update the package.json
"seed": "ts-node drizzle/seed.ts"
Install the required packages:
pnpm install tsconfig-paths ts-node --save-dev
Update the package.json
"seed": "ts-node drizzle/seed.ts"
// Class based abstraction layer for Drizzle (using nextjs) | |
import z from "zod"; | |
import { db } from "@/lib/db"; | |
import { validate } from "@/lib/validate"; | |
import { model } from "@/drizzle/schema"; | |
type NewModel = typeof model.$inferInsert; | |
type Model = typeof model.$inferSelect; |
module.exports = shipit => { | |
require('shipit-deploy')(shipit); | |
require('shipit-shared')(shipit); | |
const appName = 'hello'; | |
shipit.initConfig({ | |
default: { | |
deployTo: '/home/deployer/example.com', | |
repositoryUrl: 'https://git-provider.tld/YOUR_GIT_USERNAME/YOUR_GIT_REPO_NAME.git', |
server.express.use(async (request, response, next) => { | |
if (!request.userId) return next(); | |
const user = await db.query.user( | |
{ where: { id: request.userId } }, | |
'{ id, permission, email, name }' | |
); | |
request.user = user; | |
next(); |
There are many Git workflows out there, I heavily suggest also reading the atlassian.com [Git Workflow][article] article as there is more detail then presented here.
The two prevailing workflows are [Gitflow][gitflow] and [feature branches][feature]. IMHO, being more of a subscriber to continuous integration, I feel that the feature branch workflow is better suited.
When using Bash in the command line, it leaves a bit to be desired when it comes to awareness of state. I would suggest following these instructions on [setting up GIT Bash autocompletion][git-auto].
When working with a centralized workflow the concepts are simple, master
represented the official history and is always deployable. With each now scope of work, aka feature, the developer is to create a new branch. For clarity, make sure to use descriptive names like transaction-fail-message
or github-oauth
for your branches.
ng n MyApp --routing | |
cd MyApp | |
npm install --save '@angular/material' '@angular/cdk' | |
npm install --save '@angular/animations' | |
[In app.module.ts] | |
import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; | |
imports: [ | |
BrowserModule, | |
BrowserAnimationsModule, | |
AppRoutingModule, |
<div *ngFor="let item of data | async"> | |
{{ item.data }} | |
</div> |
emailRegex = /^[a-z0-9!#$%&'+\/=?^_`{|}~.-]+@[a-z0-9]([a-z0-9-][a-z0-9])?(.a-z0-9?)*$/i; | |
registration : FormGroup; | |
constructor(r: FormBuilder, public http :Http){ | |
this.registration = r.group({ | |
'chosen_username' : [null, Validators.required], | |
'chosen_email' : [null, Validators.pattern(this.emailRegex)], | |
'chosen_password' : [null, Validators.required], | |
}); | |
} |
#!/bin/bash | |
while true; | |
do | |
i2cget -y 1 0x48 0x00 w | | |
awk '{printf("%.1f\n", (a=( \ | |
(("0x"substr($1,5,2)substr($1,3,1))*0.0625)+0.1) \ | |
)>128?a-256:a)}' |