Skip to content

Instantly share code, notes, and snippets.

View jahe's full-sized avatar

Jannik Hell jahe

View GitHub Profile
@jahe
jahe / sql-cheatsheet.sql
Last active January 29, 2021 18:48
SQL Cheatsheet
-- Remove All Rows from a Table
TRUNCATE TABLE user;
-- Create a CHECK constraint to ensure consistency within the tables (e.g. for enumeration values or for consistency rules based on multiple columns)
-- Unnamed inline CHECK constraint
CREATE TABLE Persons (
Age int CHECK (Age>=18)
);
-- Named inline CHECK constraint
@jahe
jahe / gradle-cheatsheet.gradle
Last active December 8, 2022 07:22
Gradle Cheatsheet
// imports a couple of java tasks
apply plugin: "java"
// List available tasks in the shell
> gradle tasks
// A Closure that configures the sourceSets Task
// Sets the main folder as Source folder (where the compiler is looking up the .java files)
sourceSets {
main.java.srcDir "src/main"
@jahe
jahe / java-build-cheatsheet.java
Created August 29, 2015 00:05
Java Build Cheatsheet
There is a MANIFEST.MF file in .jar files
It supports a wide range of functionality:
* electronic signing
* version control
* package sealing
It always sits in "META-INF/MANIFEST.MF"
The creation of a .jar file includes the creation of a default manifest file
@jahe
jahe / vim-cheatsheet.vim
Last active September 8, 2019 11:58
Vim Cheatsheet
// Move cursor to end of line (eol)
$
// Move cursor to the beginning of line
0
// Move cursor to the first character of the next word
w
// Move cursor to the last character of the word
@jahe
jahe / osx-shell-cheatsheet.sh
Created September 1, 2015 20:53
OSX Shell Cheatsheet
// Open a file with the default App for this kind of filetype
open README.txt
@jahe
jahe / transact-sql-cheatsheet.sql
Created September 2, 2015 10:15
Transact-SQL Cheatsheet
-- Start Transaction update a row and rollback transaction
BEGIN TRANSACTION
UPDATE user SET username='peter' WHERE id=2
ROLLBACK TRANSACTION
-- Start Transaction update a row and commit transaction
BEGIN TRANSACTION
UPDATE user SET username='peter' WHERE id=2
COMMIT TRANSACTION
@jahe
jahe / java-ee-cheatsheet.md
Last active April 10, 2022 19:51
Java EE Cheatsheet

Java EE

Java EE consists of the following components

  • JavaBeans
  • JNDI - Java Naming and Directory Interface
  • EJB
  • Servlets
  • JDBC
  • JSP
  • RMI
  • RMI-IIOP
@jahe
jahe / mongodb-cheatsheet.sh
Created October 15, 2015 21:59
MongoDB Cheatsheet
# Start MongoDB server
> mongod
# Start MongoDB CLI client
> mongodb
# Create or open database "myDatabase"
> use myDatabase
# Show a list of all databases
@jahe
jahe / java-cheatsheet.java
Last active January 29, 2021 18:48
Java Cheatsheet
// VM Arguments vs. Program Arguments
// Program Arguments are accessible via the main() methods String[] args array
// VM Arguments are accessible via System.getProperty(<vm-arg-name>)
java [-D<vm-arg-name>=<vm-arg-value>] MyJavaProgram [<program-arg-value>]
// Activate Remote Debugging on JVM via Java Debug Wire Protocol (JDWP)
java -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=7777
// Listening for a debugger to connect: Yes or No
// No: JVM tries to connect to a debugger under the "address" field
@jahe
jahe / eclipse-cheatsheet.java
Last active February 3, 2017 15:01
Eclipse Cheatsheet
// - DEBUGGER -
// Run to a specific line
Move cursor to the line -> Press "Ctrl + R"
// Terminate execution
Ctrl + F2
// Toggle Breakpoint
Ctrl + Shift + B