This file contains 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 { Module, INestMicroservice, Logger } from '@nestjs/common'; | |
import { WorkerService } from './worker.service'; | |
import { WorkerController } from './worker.controller'; | |
import { TypeOrmModule } from '@nestjs/typeorm'; | |
import { NestFactory } from '@nestjs/core'; | |
import { Transport } from '@nestjs/common/enums/transport.enum'; | |
@Module({ | |
imports: [TypeOrmModule.forRoot()], | |
providers: [WorkerService], |
This file contains 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 { Test, TestingModule } from '@nestjs/testing'; | |
import { OrganisationTariffService } from './organisation-tariff.service'; | |
import { getRepositoryToken } from '@nestjs/typeorm'; | |
import { OrganisationTariff } from './organisation-tariff.entity'; | |
import { Repository } from 'typeorm'; | |
// @ts-ignore | |
export const repositoryMockFactory: () => MockType<Repository<OrganisationTariff>> = jest.fn(() => ({ | |
manager: { connection: { close: () => Promise.resolve() } }, | |
findOneOrFail: jest.fn(entity => entity), |
This file contains 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
#!/bin/bash | |
# https://stackoverflow.com/questions/28226229/bash-looping-through-dates | |
startdate=$(date -I -d "$1") || exit -1 | |
enddate=$(date -I -d "$2") || $(date -I) | |
d="$startdate" | |
while [ "$(date -d "$d" +%Y%m%d)" -le "$(date -d "$enddate" +%Y%m%d)" ]; do | |
echo "$d" |
This file contains 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 AWS from 'aws-sdk'; | |
async function getParameterStoreValues(names: string[], region: string) { | |
const ssm = new AWS.SSM({ region }); | |
const { Parameters = [], InvalidParameters = [] } = await ssm.getParameters({ Names: names }).promise(); | |
if (InvalidParameters.length) { | |
throw new Error(`Invalid parameter names: ${InvalidParameters.join(', ')}`); | |
} |
This file contains 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
# root/ | |
# |_ app/ | |
# | |_ Dockerfile | |
# | |_ secrets.env | |
# | |_ secrets.dev.env | |
# |_ web/ | |
# | |_ Dockerfile | |
# | |_ secrets.env | |
# | |_ secrets.dev.env |
This file contains 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
# ===================================================== | |
# USAGE | |
# $> ips="192.168.0.10 192.168.0.11 192.168.0.12" | |
# $> restrict_plex_dlna block "$ips" | |
# $> restrict_plex_dlna unblock "$ips" | |
# ===================================================== | |
restrict_plex_dlna() { | |
filters="tcp,32469 udp,1900" |
This file contains 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
body { | |
white-space: pre; | |
font-family: monaco, Consolas, Menlo, monospace; | |
color: white; | |
background: #282a36; | |
font-size: 12px; | |
line-height: 1.5m; | |
} | |
.property { |
This file contains 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 strict'; | |
const auth = require('feathers-authentication'); | |
const request = require('request'); | |
module.exports = function() { | |
const app = this; | |
const config = app.get('auth'); | |
const authHost = config.local.authHost; |
This file contains 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
#!/usr/bin/env python | |
""" | |
Patches the boto library (v2) with the correct hostnames for Amazon SQS. | |
Work around for Celery issue: | |
https://github.com/celery/celery/issues/3221 | |
which is waiting on PR in boto: | |
https://github.com/boto/boto/pull/3633 | |
""" | |
from __future__ import print_function |
This file contains 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
package main | |
import ( | |
"fmt" | |
"io" | |
"gopkg.in/cheggaaa/pb.v1" | |
"os" | |
"net/http" | |
"strconv" | |
"strings" |