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
BLUE="\[\033[01;34m\]" | |
~/code/sample-monorepo$ WHITE="\[\033[01;00m\]" | |
~/code/sample-monorepo$ PS1="${debian_chroot:+($debian_chroot)}$BLUE\w\$ $WHITE" |
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
require('crypto').publicEncrypt("-----BEGIN PUBLIC KEY-----\nMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAxm6YetHJ5gdhv7TmD9uD\nl4XErogLhypON/Hi0Qvsy3QVXukbziVKBB4pgtNU303NMTVYuakUpYuyVuOiwaTv\nXVf8gyB6MzhbaUpVkPQimbt24kAXVmIUAA/7Hg6QqfssBFfwB+vBmPPzoZflHz1M\n+sx6pdyKwM1hK41evnTzjfY11Xhc3RmmLtPxWOSF2oR+hZ2lCtDgc5CKWQ5f5ade\n4s3RNiIKaV8U0oR4SKf1ty0PSW7/C+RPO2b7NlHKurLDIsCmTjxOkyYboQlJhH3W\nevjHrDF9Oli2mRsHPMidjkTgdjdugwda38rNS6ZvFbhNWd55HtRNCxjblFhIbs0X\nln/I86fbhOPNBt3VKBhE2lV6cgFg76JI7vS12uiQmtdj1RixulrgH8xrD+gpyyoi\nORgAYtflgr1DRHFerBqGCzds/bbR6FG/Luy3yK2zzBDVPRbM4hks3/sAZf3LVtED\nWDRB9E+Vb8SRWytidkp33l5d+2V03EE4+WalpG9FRVJCFQYSXd/ebT1qVfZMECZB\nsNrZxuznBOl8cPYA2Tros/k9hE10xCDMZbWi0Q4IKqgmCW7z9HR+D22HPwyXRsVH\nK1jyT8/1r7Qg6eEHDaGWYP5QbdrXxFUx6kFSBsglKajjaQO06VGb4XnBBArDG9Hp\nV8g3LLykdaFU592oN57DkfcCAwEAAQ==\n-----END PUBLIC KEY-----\n", Buffer.from('plain-text')).toString('hex') |
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
var keys = {} | |
crypto.generateKeyPair('rsa', { | |
modulusLength: 4096, | |
publicKeyEncoding: { | |
type: 'spki', | |
format: 'pem' | |
}, | |
privateKeyEncoding: { | |
type: 'pkcs8', | |
format: 'pem', |
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
// with .resolves | |
expect(received).resolves.toBeDefined() | |
Received promise rejected instead of resolved | |
Rejected to value: [RequestError: Invalid authorization token provided: Bearer 0a933cd4bceffa68993ca34d58f31684d0923d31] | |
50 | }) | |
51 | | |
> 52 | await expect(driver.runPr()).resolves.toBeDefined() |
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 https = require('https'); | |
const child_process = require('child_process') | |
const JSON5 = require('json5') | |
const argv = process.argv.slice(2).map(x => x.trim()).filter(Boolean) | |
if (argv.length !== 3) { | |
console.log(`Usage: ${process.argv[1]} <groupId>:<artifactId> <GRPC-method> <payload>`) | |
process.exit(1) | |
} |
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 path = require('path') | |
const dirs = [ | |
'src/misc', | |
'src/cimonorepo', | |
'src/fingerprinting', | |
'src/graphs', | |
'__tests__/unit-tests/misc', | |
'__tests__/unit-tests/cimonorepo', |
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
_ "tiny insignifcant changes" | |
_1 "dead code removal" | |
_2 "followups of the previous commit, trying to make it work" | |
_3 "refactoring" |
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
_ "tiny insignifcant changes" | |
_1 "dead code removal" | |
_2 "followups of the previous commit, trying to make it work" |
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
So a common conception (perhaps I should say “misconception”) about Exceptions in Scala is that they should be avoided due to lack of referential transparency (see “do not throw exceptions” and “referential transparency”). I think this topic is a bit subtler that one might initially think. | |
The argument goes as follows: “you should be able to inline/extract variables without changing the program’s behavior. But Exceptions are not like that.” | |
The text-book example goes as follows: | |
def f1(n: Int): Int = | |
if (n == 0) throw new RuntimeException("zero") else n + 1 | |
def f2(n: Int): Int = { | |
val x = throw new RuntimeException("zero"); | |
if (n == 0) x else n + 1 | |
} | |
The only difference between these two functions is that the throw expression was extracted into a variable. However, the two functions are not equivalent (f1(4) succeeds but f2(4) fails), hence … “exceptions should be avoided”. |
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
Outdated stub in index: jar:///home/imaman/code/hackathon-sample/wix-framework/bazelbeam-intellij-projects/wixrpc_21/libs/bazelbeam_1.jar!/com/wixpress/greyhound/config/Configuration.class indexed at 1555508993369 with document size -1, doc=null, docSaved=true, wasIndexedAlready=true, queried at 1555508993369 | |
indexed lengths={chars=-1, bytes=8138} | |
doc length=-1 | |
file length=0 | |
cached PSI class org.jetbrains.plugins.scala.lang.psi.impl.ScalaFileImpl | |
projects with file: 1 | |
java.lang.Exception | |
at com.intellij.psi.stubs.StubTreeLoaderImpl.diagnoseLengthMismatch(StubTreeLoaderImpl.java:180) | |
at com.intellij.psi.stubs.StubTreeLoaderImpl.checkLengthMatch(StubTreeLoaderImpl.java:150) |
NewerOlder