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
function deferPromise<T>(): { | |
resolve: ( value?: ( PromiseLike<T> | T ) ) => void; | |
reject: ( reason?: unknown ) => void; | |
promise: Promise<T>; | |
} { | |
let resolve: ( value?: T | PromiseLike<T> ) => void; | |
let reject: ( reason?: unknown ) => void; | |
// eslint-disable-next-line promise/param-names | |
const promise: Promise<T> = new Promise( ( promiseResolve, promiseReject ) => { |
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 fs = require( 'fs' ); | |
const semver = require( 'semver' ); | |
const cwd = process.cwd(); | |
const packageJsonPath = cwd + '/package.json'; | |
const content = fs.readFileSync( packageJsonPath, 'utf-8' ); | |
const [ fullMatch, currentVersion ] = content.match( /"version": "(.*)?"/ ) || []; |
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
type GuardedType<T> = T extends (x: any) => x is (infer T) ? T : never; | |
interface Validator<T> { | |
isValid(value: any): value is any; | |
notRequired(): NotRequiredValidator<T>; | |
required(): RequiredValidator<T>; | |
nullable(): NullableValidator<T>; |
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
#include "stdafx.h" | |
#include "zadanie3.h" | |
#include <vector> | |
#include <fstream> | |
#include <iostream> | |
#include <string> | |
std::vector<int> przemnoz(const std::vector<int> &idVec) | |
{ | |
std::vector<int> resultVec; |
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
banks = [int(x) for x in open('data.txt', 'r').read().split("\t")] | |
memory_history = {} | |
counter = 0 | |
since_last_occurence = 0 | |
def redistribute(): | |
bank = banks.index(max(banks)) | |
bank_size = banks[bank] | |
banks[bank] = 0 |
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
process((params, emit) => { | |
const zip = new JSZip(); | |
const countryBlocksZip = 'GeoLite2-Country-CSV_20171003/GeoLite2-Country-Blocks-IPv4.csv'; | |
const countryLocationsZip = 'GeoLite2-Country-CSV_20171003/GeoLite2-Country-Locations-en.csv'; | |
emit(0); | |
const parseFile = (zipFile, emitPre, emitPost) => { | |
return zip |
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
using AutoMapper; | |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Runtime.InteropServices; | |
using System.Runtime.InteropServices.ComTypes; | |
using System.Linq.Expressions; | |
using AutoMapper.Execution; | |
using AutoMapper.Internal; | |
using System.Reflection; |
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
[ | |
{ | |
"name": "logger", | |
"type": "null", | |
"value": "" | |
}, | |
{ | |
"name": "routes", | |
"type": "class", | |
"value": "Symfony\\Component\\Routing\\RouteCollection" |