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
| local data = io.open("data.txt", "rb") | |
| if not data then | |
| return | |
| end | |
| local position = 50 | |
| local zeroes = 0 | |
| local crosses = 0 |
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
| { | |
| provide: 'EXAMPLE_CLIENT', | |
| inject: [ConfigService, CACHE_MANAGER], | |
| useFactory: (configService: ConfigService, cacheManager: Cache) => { | |
| const client = axios.create({ | |
| baseURL: configService.get('EXAMPLE_API_BASE_URL'), | |
| }); | |
| client.interceptors.request.use(async (config) => { | |
| let accessToken = await cacheManager.get('example_access_token'); |
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
| #!/bin/sh | |
| path=$1 | |
| token=$GIT_SYNC_COMMIT_TOKEN | |
| . ./git-sync-commit.config | |
| echo $path | |
| echo $token | |
| echo $state_branch |
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 { BadRequestException, PipeTransform } from '@nestjs/common'; | |
| import { ClassConstructor, plainToInstance } from 'class-transformer'; | |
| import { ValidationError, validate } from 'class-validator'; | |
| /** | |
| * @example | |
| * ```ts | |
| * enum ContentType { | |
| * IMAGE, | |
| * VIDEO |
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
| @Injectable() | |
| abstract class AuthGuard implements CanActivate { | |
| protected constructor( | |
| private readonly cls: ClsService, | |
| private readonly tokenValidator: Record<string, (token: string) => string | null>, | |
| ) {} | |
| canActivate( | |
| context: ExecutionContext, | |
| ): boolean { |
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
| y = Enum.reduce( | |
| String.split(input, "\n"), | |
| {[], []}, | |
| fn row, {left, right} -> | |
| x = String.split(row, " ") | |
| [l, r] = x | |
| li = String.to_integer(l) | |
| ri = String.to_integer(r) |