Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Alex Burghardt aal89

🎯
Focusing
View GitHub Profile
@aal89
aal89 / kbtxtgenerator.js
Created Jul 18, 2019
Generates text files with random numbers of a particular size. Size is given in kb's as first parameter, defaults to 100.
View kbtxtgenerator.js
const fs = require("fs");
const lineLength = 126;
const sizeInKb = process.argv[2] || 100;
let data = "";
for(var i = 0; i < sizeInKb * 1024; i++) {
if (i && i % lineLength === 0) {
data += "\n";
} else {
@aal89
aal89 / 1mb.txt
Created Jul 18, 2019
1mb in text
View 1mb.txt
This file has been truncated, but you can view the full file.
19063699041183922230424640119986913758023341770758751642047601347737139606611941581352175797681575117149435847472379921576378
82010873314125910417098681679467651061196703036344503828425038021866296075656578591024747456403918197240660392231867709196530
05547299081771122978128893134012025555840439838755861696435926779779011155301553716406948852775421829267789075611169229413304
42028620073205237675530442721666962286683534927131293735270935475331266785352417198234822645786435208887529004886675157771888
87716254578233139050956841337551473116293899780647416270305365091493516756140179109318676578254373967658333126619554398248807
73901335039931398874577719039802288956276828455645089612214856059038950787855805249688802161731552101060793394882144824301838
80013352318345613661078428780673839967965501913764666716551387847921893809223464453567368379243079836222406059944397498046708
72409291568897359376555992566277167049359808026761803186968491038946326201866824309514704973489863815255632689038911077381036
@aal89
aal89 / 1kb.txt
Created Jul 18, 2019
1kb in text
View 1kb.txt
66125646655438184824034357503490176636099264991633465762201498014519123891859268733983653039388726432642995143358504569007771
58598693402496866943402835041634570224118066330404568236483221494076492917098844866249914290879929866424562331479470484929530
47981071980750177177087538144356263522627349597567256092672809627220185268573884037546233149941048425721886017397002493771038
59789493522946388742872159309483907924798646897590296799087138432035293041592297258616156208443607672462374144231313952523825
41214722436789521357506910806784385239131212667915286065697223577192349536631069819291852420161751071280762096700317526464632
90928765621229518421461199169418959317189370377096223039048075197848769839858594855143546758093458201630388955491473164903161
19029733685356457419092050823362333977133993758927393621966880365414110809808625711116204972494708604941468381375412202718800
30757276143464395289644876909915866493212206250053550400385293673376701537468360960764657913786708380781323834871961191069325
5294339716425075
@aal89
aal89 / 10kb.txt
Created Jul 18, 2019
10kb in text
View 10kb.txt
89075337635954647102216077828334038179638965680796041208684221958292459041499210220101176726750119361506928946801115768179724
42244632672758898527798766326186965189573496725417576843236332384515325066967967084729236662659424427203830789178855960389888
59671607161000645588293584669984665020199777828148967747970527020608102921980556435899241646582421992569038754973449362160805
31239955776017464552148435666505635723861800404618684226812752076597749931057757306056294943547000781262839809899923354086591
58421004045160720410218892782153917915938163263152750197199304506126821048289291640271668334925747202569241057032162874410383
13229406649061136455569503589840650992763870062625721531357020224282471379189564485235429826481871222615972206141109473569331
50068277012583532229033541176707338889365478924968936854152065761173915111644345900669149625078722916074227614326832708754591
53533652284306970616530322571286936751979637851359030657540649747647283544275697965879550870371044054664298592239900461215946
7600905955755449
@aal89
aal89 / 100kb.txt
Last active Jul 18, 2019
100kb in text
View 100kb.txt
90008179737137449057850374296041230231448818231836430412891860501369559957934170566478171795337452573291424987820066966816786
11421932734664050282853577818350442368737025841021682351565157149258626742693172908157392514275953021340373789403811298198112
98078491418506031705393320777252539769380080434092015114759613380134199900073766190656627700475488778765198284763526475740644
27316250203873295755542616481830176762741844790191881961666387319684382599128392790817587468185935956109594742996822851456430
69484825595272003071580933663162309410919484264168162456415987660087356646694839288039098048397766765190012006438103559476605
88069969501403804546943579852833051109937002040256969349389081744254318024154760523379227341047257631357870025582656575655762
80287299653975203684260833623532172260301953877104948974634491969795223647429108528213960088039791160860481243853022341993839
24991718535415280310113584497118196223057217585054424117851185779066465713336737557959912721815816999403404005977799509009387
9410563589763257
@aal89
aal89 / batchqueue.js
Created Jul 4, 2019
Batch queue javascript
View batchqueue.js
function BatchQueue(concurrentTasks) {
this.concurrency = concurrentTasks;
this.running = 0;
this.queue = [];
}
BatchQueue.prototype.pushTask = function(task, callback) {
this.queue.push(task);
this.next();
}
@aal89
aal89 / optional.ts
Last active Jul 4, 2019
Optional class to default out variables when they do not exist.
View optional.ts
class Optional<T> {
private value: T | null = null;
private constructor(value: T | null) {
this.value = value;
}
public static some<T>(value: T): Optional<T> {
return new Optional(value);
@aal89
aal89 / DataRequest.d.ts
Created Apr 29, 2019
Declaration merging. Swift like extensions for TypeScript. Extending an Express Request object per example.
View DataRequest.d.ts
// tslint:disable
declare namespace Express {
export interface Request {
locals: {
data: unknown;
}
}
}
@aal89
aal89 / filter06.js
Last active Nov 2, 2018
A Javascript regex to filter all dutch cellphone numbers from a particular text and filter for uniqueness. Works for no mathces, one match and multiple matches.
View filter06.js
var text = `
the text containing a couple of 0612345678 numbers. like so: 0612345678 and so:
0687654321
and
another
example
0674839201
`;
// Approach one: returns an ES6 Set.
@aal89
aal89 / shell.sh
Created Oct 22, 2018
Generate rsa public/private key pair using openssl
View shell.sh
openssl genrsa -out key.pem 512
openssl rsa -in key.pem -outform PEM -pubout -out public.pem
You can’t perform that action at this time.