This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::marker::PhantomData; | |
#[allow(dead_code)] | |
fn main() { | |
let go = Builder::up() | |
.left(One { _ghost: PhantomData::<Yes> }) | |
.build(); | |
println!("{:#?}", go); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// use as before: e.g. CRYPTOFINANCE("XLM/USD") | |
// there's no way to use CRYPTOFINANCE("BINANCE:XLM/USD") without a paid account, so I didn't implement it | |
const API_KEY = 'YOUR_COINMARKETCAP_API_KEY' // do not forget to replace it with your own API key ;) | |
const domain = 'https://pro-api.coinmarketcap.com'; | |
const ticker = 'v1/cryptocurrency/quotes/latest'; | |
const options = { | |
method: 'GET', | |
headers: { | |
'X-CMC_PRO_API_KEY': API_KEY, | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const path = require('path') | |
const fs = require('fs') | |
const source = process.env.PWD | |
const filenames = fs.readdirSync(source) | |
.filter(filename => filename.indexOf('.ts') !== -1 && filename !== 'index.ts') | |
.map(filename => filename.replace('.ts', '')) | |
const content = filenames | |
.map(filename => `export * from './${filename}'`) | |
.join('\n') | |
fs.writeFileSync(path.join(source, 'index.ts'), content, { encoding: 'utf8' }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Note } from '@kroms/notes/notes.entity' | |
import { NotesModule } from '@kroms/notes/notes.module' | |
import { User } from '@kroms/notes/users.entity' | |
import { INestApplication, Injectable, Module } from '@nestjs/common' | |
import { NestFactory } from '@nestjs/core' | |
import { | |
InjectRepository, | |
TypeOrmModule, | |
TypeOrmModuleOptions, | |
} from '@nestjs/typeorm' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as Joi from '@hapi/joi' | |
import { Body, Controller, Module, NotImplementedException, Post, UsePipes } from '@nestjs/common' | |
import { NestFactory } from '@nestjs/core' | |
import axios from 'axios' | |
import * as Joiful from 'joiful' | |
import { ValidationPipe } from './validation.pipe' | |
class Implicit { | |
@Joiful.string().required() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { AuthenticatedGuard, Unauthorized } from '@kroms/auth' | |
import { Controller, Get, UseFilters, UseGuards } from '@nestjs/common' | |
@Controller() | |
export class AppController { | |
@Get('secured-page') | |
@UseGuards(AuthenticatedGuard) | |
@UseFilters(Unauthorized) // beware here it requires LocalStrategy explicit export in AuthModule | |
async securedPage() { | |
console.log(`@AppController /secured-page`) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// example of usage with Storybook | |
import MyComponent from './MyComponent' | |
import data from '../json/my-exported-graphic.json' | |
// symbol id must match in MyComponent.vue | |
const convert = raw => `<svg xmlns="http://www.w3.org/2000/svg" display="none"> | |
<symbol id="graphic"> | |
${raw.paths.map(path => '<path fill="green" d="' + path + '"/>\n')} | |
</symbol> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module "sls_user" { | |
source = "./microservice" | |
microservice_version = "1.0.0" | |
} | |
module "sls_product" { | |
source = "./microservice" | |
microservice_version = "1.0.0" | |
# microservice_active = false | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
JEST_FILES_PATTERN="spec" | |
// or JEST_FILES_PATTERN="test" | |
// or JEST_FILES_PATTERN="spec|test" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
...require('./jest.config'), | |
testMatch: ['**/?(*.)+(test).js'] | |
} |