Skip to content

Instantly share code, notes, and snippets.

@bbrother92
bbrother92 / logging.md
Last active April 15, 2021 09:38
#slf4j #cheatsheet

log4j12

Format modifiers

@bbrother92
bbrother92 / maven.md
Last active December 15, 2017 05:18
#maven #cheatsheet

Setting up

Set environment variables: M2_HOME and bin directory.
linux: export M2_HOME=/usr/local/apache-maven/apache-maven-3.3.1 export M2=$M2_HOME/bin or
export PATH=/Users/xxx/apache-maven-3.0.5/bin:$PATH

Project structure

  |-- pom.xml
  `-- src
@bbrother92
bbrother92 / grep.md
Last active January 30, 2026 23:01
#bash #regex #cheatsheet #grep

GREP Options

--max-count=number of matches before stopping search
--exclude=*.txt  with -r option

Note: Lookahead and lookbehind are Perl-style regular expression elements, so you'd have to use Perl directly, or GNU grep with the -P option, which then interprets Perl regex.

grep -o pattern file.txt **shows only the matched string** 
grep -bn pattern file.txt **shows row and col**  
grep -v pattern file.txt **inversion**  
@bbrother92
bbrother92 / JavaCheatSheet.md
Last active July 8, 2024 03:21
#cheatsheet #Java

Basic numeric types

char \u0000 16B (65535)
byte (-128 127) 
short 2B   (-32768 до 32767)
int 4B (-2147483648 до 2147483647)
long 64B (+- 9*10^18)
0154 octal
0b01101100 binary
3_000_000_000L long
@bbrother92
bbrother92 / SeleniumNotes.md
Last active June 28, 2017 16:37
Selenium cheatsheet #java
import java.lang.annotation.*;
public class TestClass {
@About
public void mtd () throws NoSuchMethodException {
Class cl = TestClass.class;
Annotation an = cl.getMethod("mtd", null).getAnnotation(About.class);
System.out.println(cl.getMethod("mtd", null).getName());
System.out.println(cl.getMethod("mtd", null).getReturnType());
#!/usr/bin/env python
"""Basic Python Cheat Sheet by Filip Kral on 2015/02/16"""
"""
Python is a cross-platform, interpreted, object-oriented programming language.
That means you can run it on Linux, Windows, Mac, and other platforms,
you don't need to compile your code to execute it because it is compiled on
the fly, and you can use classes and objects.
def foo(bar=[]): # bar is optional and defaults to [] if not specified
... bar.append("baz") # but this line could be problematic, as we'll see...
... return bar
#=========
print dir(math)
print type(2.)
duck_index =animals.index("duck") # Use index() to find "duck"
animals = animals.insert(duck_index,"cobra")
square_list.sort()
//Generate JavaDoc -> "Other command line argument" "-encoding UTF-8 -docencoding UTF-8 -charset UTF-8"
@bbrother92
bbrother92 / Iterable.java
Last active December 19, 2016 15:40
#collections
public class Main {
public static void main(String... args) {
Box bx = new Box();
for (Human o : bx) {
System.out.println(o);
}
}
}