Skip to content

Instantly share code, notes, and snippets.

@jei0486
jei0486 / log4j2.xml
Created November 11, 2023 16:34
log4j2.xml
<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="info" monitorInterval="30">
<Properties>
<Property name="LOG_DATE_PATTERN">{yyyy-MM-dd HH:mm:ss.SSS}</Property>
<Property name="LOG_LEVEL_PATTERN">{-%5p}{FATAL=red blink, ERROR=red, WARN=yellow bold, INFO=green, DEBUG=green bold, TRACE=blue} %style{${sys:PID}}{magenta} [%15.15t] %style{%-40.40C{1.}(:%L)}{cyan}</Property>
<Property name="LOG_MESSAGE_PATTERN">: %m%n%xwEx</Property>
</Properties>
<Appenders>
<Console name="CONSOLE" target="SYSTEM_OUT">
@danishi
danishi / SelectCase.bat
Created March 19, 2022 14:47
CASE expression in a batch file
@echo off
set Case=?
set /p Case=?
:Select
goto Case%Case%
:Case1
echo case1
/*
Display Custom Characters on 16×2 LCD
For more details, visit: https://techzeero.com/arduino-tutorials/custom-characters-on-16x2-lcd/
*/
#include<LiquidCrystal.h>
LiquidCrystal lcd(12,11,5,4,3,2);
byte smile[8] = {0b00000,0b01010,0b00000,0b00000,0b10001,0b01110,0b00000,0b00000};
@Hakky54
Hakky54 / java_keytool_cheat_sheet.md
Last active September 25, 2025 20:37
Keytool Cheat Sheet

Keytool CheatSheet 🔐

Some history

This cheat sheet came into life when I started working on a tutorial of setting up one way tls and two way tls, which can be found here: GitHub - Mutual TLS SSL

Creation and importing

Generate a Java keystore and key pair

keytool -genkeypair -keyalg RSA -keysize 2048 -keystore keystore.jks -alias server -validity 3650
@seanh
seanh / vimgrep.md
Last active September 24, 2025 03:33
vimgrep cheatsheet

vimgrep

  • Vimcasts on vimgrep

  • Uses native vim regexes (which are slightly different from the regexes used by grep, ack, ag, etc) so the patterns are the same as with vim's within-file search patterns.

You can do a normal within-file search first, then re-use the same pattern to

@DrSensor
DrSensor / Advanced Markdown Tricks.md
Last active January 7, 2026 21:18
Advanced Markdown Tricks

Repository

What Will I Learn?

In general, you will learn some markdown tricks combined with standard HTML tags. In more details what you will learn:

  • Hide-show content
  • Writing codeblocks inside codeblocks
  • Combining and using italic, bold, superscript, subscript, and/or strikethrough
  • Quoting long sentence (using nested blockquotes)
@jlaine
jlaine / pagination-page.ts
Last active November 2, 2020 09:35
Angular pagination - page
export class Page<T> {
count: number; // total number of items
next: string; // URL of the next page
previous: string; // URL of the previous page
results: Array<T>; // items for the current page
}
@mobynote
mobynote / DemoRepository
Created March 7, 2018 03:17
Use jdbcTemplate implement a pagination in spring
package com.domain;
import com.domain.Module;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;
@MgenGlder
MgenGlder / map.js
Last active December 18, 2020 03:14
Convert map to http params
mapToHttpParams(params)
function mapToHttpParams (m : Map) : String {
let s = "";
if (!empty(m)) {
for(let key in m) {
let value = m[key];
if (!empty(value)) {
s = StringUtils.format("{0}{1}{2}={3}",
s,
(s.length != 0) ? "&":"",
@felipeochoa
felipeochoa / comment-form.js
Created April 7, 2017 16:35
@-mentions for Quill
const quillModules = {
toolbar: ["bold", "italic", "underline", "strike"],
// mentions is added in constructor
keyboard: {
bindings: {
tab: {
key: 9,
handler: function(range, context) {
return this.quill.mentionHandler(range.context);
}