Skip to content

Instantly share code, notes, and snippets.

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

Roman moltar

📦
Building stuff.
View GitHub Profile
@martin-fv
martin-fv / PostList.stories.tsx
Last active April 5, 2024 19:41
Storybook mocking and Supertest with tRPC v10
import { Meta } from "@storybook/react/types-6-0";
import { PostList } from "../PostList";
import { getTRPCMock } from "../getTrpcMock";
export default {
title: "Components/PostList",
component: PostList,
} as Meta;
export const PostListPage = () => {
import {
Stack,
StackProps,
RemovalPolicy,
aws_rds as rds,
aws_ec2 as ec2,
custom_resources as cr,
CfnResource,
} from 'aws-cdk-lib'
import { Construct } from 'constructs'
@VanTanev
VanTanev / io-ts-stringify.ts
Last active June 29, 2020 11:39
Extract static type strings from io-ts definitions
import * as t from 'io-ts'
import * as gen from 'io-ts-codegen'
import { NullableType } from 'codecs/util/nullable'
export function stringifyNaive(identifier: string, codec: t.Any): string {
return `type ${identifier} = ${codec.name}`
}
export function stringifyFull(identifier: string, codec: t.Any): string {
return `type ${identifier} = ${gen.printStatic(getType(codec))}`
@archisgore
archisgore / gist:d1dda9965db63342546501689fa3f309
Created May 3, 2020 07:05
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);
}
@swalkinshaw
swalkinshaw / tutorial.md
Last active November 13, 2023 08:40
Designing a GraphQL API
@parmentf
parmentf / GitCommitEmoji.md
Last active May 6, 2024 18:30
Git Commit message Emoji
@tsibley
tsibley / carton-orphans
Created September 15, 2015 21:04
Carton pruning
#!/bin/bash
# From the releases mentioned in cpanfile.snapshot, filter out those mentioned in `carton tree`
if ! grep --version | grep -q GNU; then
echo "GNU grep is required; BSD grep is too feeble"
exit 1
fi
grep -vFf <(carton tree | grep -oP '(?<=\().+(?=\))') <(grep -P '^ \S' cpanfile.snapshot) | cut -c 3-
@dominicfallows
dominicfallows / Digital Project - Development Contract - Agency (or Company) to Freelancer.md
Last active October 9, 2023 18:47 — forked from malarkey/Contract Killer 3.md
Example contract for use by Creative, Digital and Marketing Agencies (or any company for that matter) to use when contracting a Freelance Web Developer on digital projects.
@alexlarsson
alexlarsson / gist:c8e3277d2678c1061319
Last active June 2, 2020 00:41
Private files in docker container

Private files in docker container

It is sometimes necessary to have files in a container that shouldn't ever end up in an image. These files are generally some form of private key or password that aren't allowed to be distributed. This document details a few usecases for such files and their requirements.

Use Cases

Private keys for packages

@moltar
moltar / rc
Created December 26, 2013 19:01
Make cpanm cache tar balls locally. Put this line in your .bashrc or .zshrc file.
export PERL_CPANM_OPT="--cascade-search --save-dists=$HOME/.cpanm/cache --mirror=$HOME/.cpanm/cache --mirror=http://search.cpan.org/CPAN"