Skip to content

Instantly share code, notes, and snippets.

View romach's full-sized avatar

Roman Cherepanov romach

View GitHub Profile
@romach
romach / install-sdkman.sh
Created December 19, 2023 17:50
Install SDKMAN! on Ubuntu
curl -s "https://get.sdkman.io" | bash
source "$HOME/.sdkman/bin/sdkman-init.sh"
sdk version
@romach
romach / terraform_installer.sh
Last active January 25, 2021 21:33 — forked from Vidimensional/terraform_installer.sh
Terraform Installer
#!/bin/bash
# sudo ./terraform_installer.sh -a linux_amd64
set -e
while getopts a: flag
do
case "${flag}" in
a) ARCHITECTURE=${OPTARG};;
@romach
romach / index.js
Last active October 11, 2020 19:58
Add POST endpoint to express application
const express = require('express')
const bodyParser = require('body-parser')
// instantiate express application
const app = express()
app.use(bodyParser.urlencoded({extended: true}))
app.use(bodyParser.json())
// create POST route
app.post("/", (req, res) => {
@romach
romach / index.js
Last active October 11, 2020 19:34
Create Express application
const express = require('express')
// instantiate express application
const app = express()
// create simple route
app.get('/', (req, res) => {
res.send('Hello world!')
})
@romach
romach / index.js
Last active October 11, 2020 16:28
Save video from Azure Storage
const azure = require('azure-storage');
const fs = require('fs');
const STORAGE_ACCOUNT_NAME = '<STORAGE_ACCOUNT_NAME>';
const STORAGE_ACCESS_KEY = '<STORAGE_ACCESS_KEY>';
const blobService = azure.createBlobService(STORAGE_ACCOUNT_NAME, STORAGE_ACCESS_KEY);
const containerName = "videos";
const videoPath = "SampleVideo_1280x720_1mb.mp4";
// retrieve video properties
blobService.getBlobProperties(containerName, videoPath, (err, properties) => {
npm init -y
  • import FormsModule
  • create form with input and submit-type button
  • in <form>
    • create #f template variable and assign ngForm to it
    • add (ngSubmit) output, use f.value as handler's parameter
  • in <input> tag:
    • add name attribute
  • add ngModel attribute
(event)="doSomething($event); $event.stopPropagation()"
ng g c user-list
ng serve
npm start