Skip to content

Instantly share code, notes, and snippets.

View ipavlovski's full-sized avatar

ipavlovski

View GitHub Profile
@ipavlovski
ipavlovski / App.tsx
Last active March 31, 2022 02:23
React Typescript
import React from "react"
import { useState, useEffect } from "react"
function App() {
return (
<Main>
<Button></Button>
<div style={{ background: "grey" }}>
<Headline></Headline>
</div>
@ipavlovski
ipavlovski / README.md
Last active March 30, 2022 21:10
Prisma

Installation

Install the dependenies, then create the DB through migrate command.

npm i
npx prisma migrate dev --name init

On changes in the schema, need to run:

@ipavlovski
ipavlovski / sqlite.ts
Created March 17, 2022 14:10
SQLite with node/typescript
// install node-sqlite3 with upgraded libs
// npm install sqlite3 --build-from-source --sqlite=/usr/include
import sqlite3 from 'sqlite3'
var testdb = new sqlite3.Database(':memory:')
testdb.run('create table test1 (name TEXT)')
testdb.all('select * from test1', (err, row) => console.log(row))
testdb.run(`insert into test1 (name) values ('name1')`, function (err) {
console.log({ changes: this.changes, lastID: this.lastID })
})
@ipavlovski
ipavlovski / cartopy.py
Last active February 22, 2023 18:43
Python snippets
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
plt.ion()
fig, axs = plt.subplots(1, 1)
import cartopy.crs as ccrs
import cartopy.feature as cfeature