- Most important:
F3
/Ctrl+click
: Go to declaration.Ctrl+Alt+H
: show all uses (calls) of a method.Alt+Left
: previous cursor position.
- Important:
F4
: show Type Hierarchy.Ctrl+O
: search for method in class (great for navigating big classes).
- Others:
Ctrl+Shift+F
: Format selection.
Alt+Shift+A
: Toggle block-editing mode.
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
git grep -l TODO | xargs -n1 git blame -fe --date=short | grep TODO | sed -E 's#\(#,\(#; s#<([a-z]+@[a-z]+\.com)>#,\1,#; s#([0-9]{4}-[0-9]{2}-[0-9]{2})#\1,#; s@(\/\/|#|\/\*)(.*TODO.*)@,"\1\2"@; s#[0-9a-f]{10}##' > todos_$(date +%s).csv |
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
#!/usr/bin/env python3 | |
import sys | |
import io | |
import zipfile | |
import tempfile | |
from pathlib import Path | |
import sqlite3 | |
import json | |
import shutil |
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
/** `zip([a, b, c], [1, 2, 3] => [[a, 1], [b, 2], [c, 3]])` */ | |
const zip = (a: Array<any>, b: Array<any>) => | |
Array.from(Array(Math.max(b.length, a.length)), (_, i) => [a[i], b[i]]); | |
/** Generic version of String.join(). Add a separator element between each of the elements. */ | |
const join = (a: Array<any>, separator: any) => | |
zip(a, Array(a.length - 1).fill(separator)) | |
.flat() | |
.splice(-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
import random | |
import string | |
# https://pynative.com/python-generate-random-string/ | |
def randomString(stringLength=10): | |
"""Generate a random string of fixed length """ | |
letters = string.ascii_lowercase | |
return ''.join(random.choice(letters) for i in range(stringLength)) |
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
/** | |
* Use to wrap a block of code in a test that should throw an exception. | |
* @param errorMsg Message to show if the block of code DOESN'T throw an exception. Optional. | |
* @param withExceptionHaving Substring that the thrown exception must contain. Optional. | |
* Checking exception strings is generally discouraged, and will cause the need to | |
* periodically readjust the expected strings, but it guarantees the error is the expected one. | |
*/ | |
fun shouldFail(errorMsg: String = "Should have failed.", withExceptionHaving: String? = null, method: () -> Unit) { | |
try { | |
method() |
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
#!/bin/bash | |
for x in *.*; do | |
d=$(date -r "$x" +%Y-%m-%d) | |
mkdir -p "$d" | |
mv -- "$x" "$d/" | |
done |
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
// https://www.westworld.be/range-in-es6/ | |
//range from 0 => n | |
const range =[...Array(n).keys()]; | |
console.log(range); | |
//Range from start => end |
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
[alias] | |
alias = config --get-regexp ^alias\\. | |
co = checkout | |
cob = checkout -b | |
logtree = log --all --decorate --oneline --graph | |
logi = log --oneline | |
c = commit -m | |
ac = commit -am | |
cp = cherry-pick | |
b = branch |
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
if(pm.environment.get("key") === undefined){ | |
pm.environment.set("key", "value"); | |
} |
NewerOlder