Skip to content

Instantly share code, notes, and snippets.

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

Roman moltar

📦
Building stuff.
View GitHub Profile
@moltar
moltar / email.html
Created October 14, 2024 11:08
mjml sample
<!doctype html><html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office"><head><title></title><!--[if !mso]><!--><meta http-equiv="X-UA-Compatible" content="IE=edge"><!--<![endif]--><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta name="viewport" content="width=device-width,initial-scale=1"><style type="text/css">#outlook a { padding:0; }
body { margin:0;padding:0;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%; }
table, td { border-collapse:collapse;mso-table-lspace:0pt;mso-table-rspace:0pt; }
img { border:0;height:auto;line-height:100%; outline:none;text-decoration:none;-ms-interpolation-mode:bicubic; }
p { display:block;margin:13px 0; }</style><!--[if mso]>
<noscript>
<xml>
<o:OfficeDocumentSettings>
<o:AllowPNG/>
<o:PixelsPerInch>96</o:PixelsPerInch>
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