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
| type Command = | |
| 'foo0' | |
| | 'foo1' | |
| | 'foo2' | |
| | 'foo3' | |
| | 'foo4' | |
| | 'foo5' | |
| | 'foo6' | |
| | 'foo7' | |
| | 'foo8' |
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 { BenchSuite } from '../bench'; | |
| const memoize = require('memoizee'); | |
| function memoizeWithJIT(fn: Function, options: { stackSize: number } = { stackSize: 10 }): Function { | |
| const stacks: string[] = []; | |
| const variables: string[] = []; | |
| const argNames: string[] = []; | |
| for (let a = 0; a < fn.length; a++) { |
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
| enum OP { | |
| string = 0, | |
| number = 1, | |
| boolean = 2, | |
| object = 3, | |
| function = 4, | |
| array = 5, | |
| date = 6, | |
| class = 7, | |
| interface = 8, |
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
| #!/usr/bin/env ts-node-script | |
| import 'reflect-metadata'; | |
| import { Application, onServerMainBootstrap } from '@deepkit/framework'; | |
| import { injectable, InjectorContext } from '@deepkit/injector'; | |
| import { t } from '@deepkit/type'; | |
| import { AppModule, AppModuleConfig } from '@deepkit/app'; | |
| import { ClassType } from '@deepkit/core'; | |
| import { eventDispatcher } from '@deepkit/event'; | |
| type Options = { exchange: string, routingKey: string, queue: string }; |
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
| #!/usr/bin/env ts-node-script | |
| import 'reflect-metadata'; | |
| import { Application } from '@deepkit/framework'; | |
| import { http } from '@deepkit/http'; | |
| import { ClassSchema, entity, getClassSchema, t } from '@deepkit/type'; | |
| import { Database } from '@deepkit/orm'; | |
| import { MongoDatabaseAdapter } from '@deepkit/mongo'; | |
| import { ClassType, getObjectKeysSize } from '@deepkit/core'; | |
| import { AppModule } from '@deepkit/app'; |
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
| #!/usr/bin/env ts-node-script | |
| import 'reflect-metadata'; | |
| import { Application, KernelModule } from '@deepkit/framework'; | |
| import { http } from '@deepkit/http'; | |
| import { entity, t } from '@deepkit/type'; | |
| import { Database } from '@deepkit/orm'; | |
| import { SQLiteDatabaseAdapter } from '@deepkit/sqlite'; | |
| @entity.name('user') | |
| class User { |
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
| //this is more or less pseudocode, not tested, just to demonstrate how it could look like conceptually. | |
| import {AppServerModule} from './src/main.server'; | |
| import {ngExpressEngine} from '@nguniversal/express-engine'; | |
| const puppeteer = require('puppeteer'); | |
| const {join} = require('path'); | |
| const {readFileSync} = require('fs'); | |
| async function main() { | |
| const renderer = ngExpressEngine({ |
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
| sudo mount -uw / | |
| rm -rf /System/Library/Extensions/AMDRadeon* | |
| rm -rf /System/Library/Extensions/GeForce* | |
| rm -rf /System/Library/Desktop\ Pictures/* | |
| find /System/Library/Templates/Data/System/Library/Speech -name PCMWave -exec rm -rf {} \; | |
| rm -rf /System/Library/Screen\ Savers/*.saver | |
| rm -rf /private/var/db/dyld |
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
| ``` | |
| screen ~/Library/Containers/com.docker.docker/Data/vms/0/tty | |
| ``` |
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 Dockerode from "dockerode"; | |
| import * as stream from "stream"; | |
| import {ContainerCreateOptions, HostConfig} from "dockerode"; | |
| export async function dockerRunWithStdIn( | |
| docker: Dockerode, | |
| stdin: NodeJS.ReadableStream | Buffer, | |
| options: {name: string} & ContainerCreateOptions | |
| ): Promise<Buffer> { | |
| return await new Promise<Buffer>(async (resolve, reject) => { |