Skip to content

Instantly share code, notes, and snippets.

View LIttleAncientForestKami's full-sized avatar

Tomasz Borek LIttleAncientForestKami

View GitHub Profile
@LIttleAncientForestKami
LIttleAncientForestKami / csp.html
Created December 8, 2023 14:30
Content Security Policy demo with XSS attack
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>XSS Demo</title>
<meta http-equiv="Content-Security-Policy" content="" />
</head>
@LIttleAncientForestKami
LIttleAncientForestKami / readme.adoc
Last active January 2, 2023 22:11
Icons for VIFM

How to install icons

  1. Install vifm

  2. Install Nerd Fonts Mono

    mkdir -p ~/.local/share/fonts
    cd ~/.local/share/fonts && curl -fLo "IBM 3270 Nerd Font Complete.otf" https://github.com/ryanoasis/nerd-fonts/blob/master/patched-fonts/3270/Regular/complete/IBM%203270%20Nerd%20Font%20Complete.otf?raw=true
    cd ~/.local/share/fonts && curl -fLo "IBM 3270 Nerd Font Complete Mono.otf" https://github.com/ryanoasis/nerd-fonts/blob/master/patched-fonts/3270/Regular/complete/IBM%203270%20Nerd%20Font%20Complete%20Mono.otf?raw=true
@LIttleAncientForestKami
LIttleAncientForestKami / Adres.java
Created October 24, 2018 09:10
Podroby - przykład (Mocking - an example)
package pl.edu.lafk.tdd.podroby;
/**
* @author Tomasz @LAFK_pl Borek
*/
class Adres {
String ulica;
short nrLokalu;
short nrDomu;
@LIttleAncientForestKami
LIttleAncientForestKami / VimLearning.md
Last active August 28, 2018 16:18
Vim learning resources

Why bother? Explained by Jim Dennis in accepted answer to a common question: https://stackoverflow.com/questions/1218390/what-is-your-most-productive-shortcut-with-vim which actually ponders why bother with VIM if it breaks "the default" Ctrl+f, Ctrl+C, Ctrl+V, Ctrl+A that one learned from other (usually MS) tools...

Absolute basics and necessary

vimtutor -> man vim -> and when in Vim ':help whatever-you-need-help-on'.

Also, echo "set nocompatible" >> ~/.vimrc so that your Vim acts like Vim and not like VI. >> appends, to not overwrite if you already had a Vim config file (.vimrc).

Getting practice

@LIttleAncientForestKami
LIttleAncientForestKami / lista.md
Created June 8, 2018 08:49
recenzowanie - lista

Migawki

  1. opisy - "dlaczego", nie "co" czy "jak"?
  2. Czy migawki się powtarzają? - git log --format="%B" | sort | uniq -c | head
  3. Czy ich opisy są użyteczne?
  4. długość opisów? - git log --format="%B" > l; awk '{ print length($0); }' l | sort -n, do CSV i rób wykres i licz średnią
  5. spójność opisów (te same nazwy, styl)? - git log --format="%B" | sort
  6. czas teraźniejszy w nich? - j.w.
  7. opisy odwołują się do czegoś (kwitów, konkretnych poprawek, recek, komciów, wymagań)?
  8. % rozległych?
  9. Ile % migawek ma pliki znikąd?
@LIttleAncientForestKami
LIttleAncientForestKami / Java4Maven.md
Created June 7, 2018 14:17
Maven and Java solutions

Maven and Java:

Diagnosis first:

echo "Path (since javac should be on it): $PATH"
echo "JAVA_HOME (since it overrides path): $JAVA_HOME"
  # consider also 
which java
  # and follow the links to find which Java you are using
java -version
@LIttleAncientForestKami
LIttleAncientForestKami / start.md
Last active September 1, 2018 10:03
Rozczajka Freeminda
@LIttleAncientForestKami
LIttleAncientForestKami / ANSI.java
Created May 22, 2018 21:04
ANSI colours in Java
package pl.edu.lafk.colours;
enum ANSI {
RESET("\u001B[0m"),
BLACK("\u001B[30m"),
RED("\u001B[31m"),
GREEN("\u001B[32m"),
YELLOW("\u001B[33m"),
BLUE("\u001B[34m"),
PURPLE("\u001B[35m"),
@LIttleAncientForestKami
LIttleAncientForestKami / pom.xml
Last active September 24, 2023 15:41
Maven POM with UTF8 encoding, compiler props, maven plugins (compiler, resources, jar) and sources for why
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>pl.lafk</groupId>
<artifactId>#APP</artifactId>
<version>0.1</version>
<name>#NAME</name>
@LIttleAncientForestKami
LIttleAncientForestKami / Main.java
Created February 14, 2018 09:44
Hazelcast training
package com.hazelcast;
public class Main {
public static void main(String[] args) {
// Add necessary code to start up a Hazelcast instance and
// run the application multiple times to cluster them up
}
}