Skip to content

Instantly share code, notes, and snippets.

View gerzhan's full-sized avatar

Nikolay Gerzhan gerzhan

View GitHub Profile
// unofficial sqlite3 types.
// These are typed only for my scope
declare module "@sqlite.org/sqlite-wasm" {
type InitOptions = {
print: (...msg: any[]) => void;
printErr: (...msg: any[]) => void;
};
declare type PreparedStatement = {
@gerzhan
gerzhan / README.md
Last active December 8, 2023 05:31
SQLite WebAssembly (WASM) for TypeScript Application

SQLite WASM

  • создать директорию для бибилиотеки
$mkdir -p src/lib/sqlite-wasm/worker
  • скачать архив sqlite.org/2023/sqlite-wasm-3440200.zip
  • распаковать и перенести директорию jswasm в src/lib/sqlite-wasm/jswasm
  • создать файлы для кода запуска worker и инициализации БД
@gerzhan
gerzhan / machine.js
Created October 10, 2023 12:42
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@gerzhan
gerzhan / ts-quasar-cli.md
Created May 26, 2019 07:50 — forked from snowyu/ts-quasar-cli.md
Add the typescript supports to quasar framework

Note: This guide applies to the project created by quasar-cli.

First install typescript and ts-loaderpackages in your project.

npm i -D typescript ts-loader

Then modified the quasar.conf.js file in your project:

@gerzhan
gerzhan / README.md
Created July 13, 2018 17:11 — forked from joyrexus/README.md
Form/file uploads with hapi.js

Demo of multipart form/file uploading with hapi.js.

Usage

npm install
npm run setup
npm run server

Then ...

Testing An Angular CLI Project in a Headless Environment

I recently started a new project and we used [Angular CLI][4] to get started. Angular CLI, as in the name, is a command line utility for creating and managing Angular 2 projects. Using Angular CLI to create a project is very easy and it gives you a great starting point for new Angular 2 projects. The only draw back I found was that in my mind it wasn't CI ready.

Angular CLI out of the box gives you a few unit tests and an end to end (e2e) test. This is great because you can generate a project and set up your build server to build the artefacts. This is where I ran into problems.

Having everything generated for you is great until something you want to do does not work; and this is where I was. I wanted to build and test my angular application on a headless build agent. The generated code from Angular CLI runs tests using Google Chrome by default. Which is fine, but running Google Chrome on a bui

@gerzhan
gerzhan / Docker shell commands.sh
Created May 25, 2018 07:41 — forked from bahmutov/Docker shell commands.sh
A personal cheat sheet for running local Node project in a Docker container
# See list of docker virtual machines on the local box
$ docker-machine ls
NAME ACTIVE URL STATE URL SWARM DOCKER ERRORS
default * virtualbox Running tcp://192.168.99.100:2376 v1.9.1
# Note the host URL 192.168.99.100 - it will be used later!
# Build an image from current folder under given image name
$ docker build -t gleb/demo-app .
#!/bin/bash
url="https://gist.githubusercontent.com/RichardBronosky/2d04c7c2e9a5bea67cd9760a35415a3f/raw/install_mongo.sh"
script="/tmp/userdata.sh"
echo "Running userdata script as $(whoami) from $(pwd)"
# Log commands to stdout and vicariously /var/log/cloud-init-output.log
set -o xtrace
# Exit on error
#!/bin/bash
url="https://gist.githubusercontent.com/RichardBronosky/2d04c7c2e9a5bea67cd9760a35415a3f/raw/install_mongo.sh"
script="/tmp/userdata.sh"
echo "Running userdata script as $(whoami) from $(pwd)"
# Log commands to stdout and vicariously /var/log/cloud-init-output.log
set -o xtrace
# Exit on error
@gerzhan
gerzhan / .jsbeautifyrc
Last active November 26, 2017 05:15 — forked from wzup/.jsbeautifyrc
.jsbeautifyrc file example
{
// The plugin looks for a .jsbeautifyrc file in the same directory as the
// source file you're prettifying (or any directory above if it doesn't exist,
// or in your home folder if everything else fails) and uses those options
// along the default ones.
// Details: https://github.com/victorporof/Sublime-HTMLPrettify#using-your-own-jsbeautifyrc-options
// Documentation: https://github.com/einars/js-beautify/
"html": {
"allowed_file_extensions": ["htm", "html", "xhtml", "shtml", "xml", "svg", "dust"],