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
export const KILOGRAM_TO_POUND = 2.20462; | |
export const POUND_TO_KILOGRAM = 0.453592; |
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 { Elevator } from './elevator'; | |
import { Load } from './load'; | |
describe(Elevator.name, () => { | |
it('should throw a RangeError when attempting to create an elevator with negative capacity', () => { | |
expect(() => new Elevator(-1)).toThrow(RangeError); | |
}); | |
it('should successfully create an elevator with a valid capacity', () => { | |
const capacity = 400; |
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 } from '@nestjs/common'; | |
import { AppController } from './app.controller'; | |
import { AppService } from './app.service'; | |
import { TenancyModule } from '@app/tenancy'; | |
import { OrderModule } from './order'; | |
import { PaymentModule } from './payment'; | |
import { Request } from 'express'; | |
@Module({ | |
imports: [TenancyModule.forRoot({ |
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
const { createEntityAttribute, CASE_SENSITIVE, NULLABLE, UNIQUE } = require('reaves') | |
const { generate } = require('randomstring') | |
const redis = require('redis') | |
const uuidv4 = require('uuid/v4') | |
const client = redis.createClient() | |
const entityName = 'player' | |
const attributeName = 'nickname' | |
const flags = CASE_SENSITIVE | NULLABLE | UNIQUE | |
createEntityAttribute(client, entityName, attributeName, flags, (err, playerNickname) => { | |
if (err) { |
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
@Override | |
public void onCreate() { | |
super.onCreate(); | |
try { | |
String packageName = getPackageName(); | |
PackageInfo packageInfo = getPackageManager().getPackageInfo(packageName, PackageManager.GET_SIGNATURES); | |
for (Signature signature : packageInfo.signatures) { | |
MessageDigest messageDigest = MessageDigest.getInstance("SHA"); | |
messageDigest.update(signature.toByteArray()); |
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
version: '2' | |
services: | |
test: | |
image: node:latest | |
working_dir: /app | |
volumes: | |
- .:/app | |
command: | |
npm run mocha | |
links: |
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 sh | |
set -e | |
read sha1_old sha1_new refname | |
WORK_TREE=/srv/admin/apps/si-mysql-maint | |
NVM="${HOME}/.nvm/nvm.sh" | |
mkdir -p ${WORK_TREE} |