Skip to content

Instantly share code, notes, and snippets.

View moltar's full-sized avatar
📦
Building stuff.

Roman moltar

📦
Building stuff.
View GitHub Profile
diff --git a/ipn/store/awsstore/store_aws.go b/ipn/store/awsstore/store_aws.go
index 0fb78d45..f233573c 100644
--- a/ipn/store/awsstore/store_aws.go
+++ b/ipn/store/awsstore/store_aws.go
@@ -7,9 +7,11 @@
package awsstore
import (
+ "bytes"
"context"
@moltar
moltar / gist:17ef5ac9da5b9bace73da725cd979292
Created June 3, 2022 08:55 — forked from archisgore/gist:d1dda9965db63342546501689fa3f309
Convert json-schema into AWS Glue struct schema (for automating JSON parsing in Glue using AWS CDK)
import request from 'sync-request';
import * as glue from '@aws-cdk/aws-glue';
export function polytectJsonSchemaToGlue(): glue.Type {
console.log("Getting Polytect reference schema...")
const res = request('GET', 'https://raw.githubusercontent.com/polyverse/polytect/master/reference/schema.json');
const body = res.getBody();
const schema = JSON.parse(body.toString());
return recursiveGlueColumns(schema, schema.definitions);
}
#!/usr/bin/env node
const { writeFileSync, readFileSync, unlinkSync } = require('fs')
const package = require('./package.json')
const packageLock = require('./package-lock.json')
const TEMPLATE_GITHUB_REPOSITORY = 'org/template'
const { GITHUB_REPOSITORY } = process.env
private async $request<R extends Runtype<any>>(config: AxiosRequestConfig, type?: R): Promise<Static<R>> {
// serialize to JSON
if (config.data && isObject(config.data)) {
config.data = JSON.stringify(config.data)
}
const { data, status, statusText } = await this.axios.request<any, AxiosResponse<Static<R>>>(config)
if (status === 204) {
return
@moltar
moltar / bull-arena-dynamic-queue-names.ts
Created March 3, 2020 06:49
A script that uses dynamic queue name discovery to build Bull Arena object, without having to manually specify each queue name.
import Arena from 'bull-arena'
import { uniq } from 'lodash'
import { getConnection } from './redis-connection'
import { config } from '../config'
const BULL_PREFIX = 'bull'
const HOST_ID = '__'
type Queue = Parameters<typeof Arena>[0]['queues'][0]
@moltar
moltar / hz.csv
Created September 23, 2019 16:11
name hz
JSON Encode Decode 79966.79245582566
runtypes 41973.09084616639
io-ts 337073.6125561012
class-validator sync 73694.89411739286
class-validator async 61958.63602038928
@moltar
moltar / keybase.md
Created June 29, 2019 00:10
Keybase Verification

Keybase proof

I hereby claim:

  • I am moltar on github.
  • I am m0ltar (https://keybase.io/m0ltar) on keybase.
  • I have a public key ASDLvYBxhyuKFzV36gxSdrS39t-KbM6KiCjaXBSL5L_xwAo

To claim this, I am signing this object:

module.exports = async function pdf(url, req) {
const browser = await puppeteer.launch()
const page = await browser.newPage()
await page.goto(
'https://.....c9users.io/clients/' +
req.params.id +
'/reports/monthlyreport/' +
req.params.marketplace +
'/' +
interface A {
foo: number
}
interface B {
bar: number
}
type C = A | B
class A {
get a() {
return 1
}
}
class B {
get b() {
return 2
}
}