Skip to content

Instantly share code, notes, and snippets.

@vpiotr
vpiotr / xnode_as_cache.cpp
Last active July 15, 2024 21:27
Demonstrates how to use xnode as cache.
#include "xnode_property_list.h"
#include "xnode.h"
xnode_named_list cache;
// already existing entries will automatically destroyed and replaced
cache.put("MAMA", xnode.value_of("mama"));
cache.put("PAPA", xnode().hold(new Person("PAPA")));
cache.put("TARPAN", xnode().hold(new Car("TARPAN")));
@vpiotr
vpiotr / gnome_commander_centos6.md
Last active October 9, 2016 20:17
Gnome Commander 1.4 installation procedure

HOWTO: Compile & Install Gnome Commander 1.4 on CentOS 6 From TAR

Introduction

Currently there is no automatic way to install Gnome Commander on CentOS 6. Below you will find instructions how to do that using install from compiled sources. Note that this is not a clean install and some things can be missing - it is always best to use automatic install (if available).

Tested environments

@vpiotr
vpiotr / gedit_update.md
Created July 27, 2016 17:07
gedit - update instruction for Linux Mint 17

HOWTO: Update gedit to v. 3.x in Linux Mint

Introduction

In default setup, Linux Mint installs gedit in version 2.x. In order to use more recent version of this editor (for example for Markdown support), you can follow the instruction below.

Tested environment

Linux Mint 17.3

package passgen;
import java.util.Random;
import java.util.Scanner;
/**
* Exercise 37 from "Exercises for programmers".
* @author Piotr Likus
*/
public class PassGen {
@vpiotr
vpiotr / 99bottles.js
Created October 12, 2017 05:27
99 Botttles of Beer in JavaScript
// 99 Botttles of Beer (see http://www.99-bottles-of-beer.net/)
// Language: JavaScript (SeaMonkey)
//
// Features:
// * no usage of digits
// * strings are not repeated
// * no external libs required
function bottles(x) {
@vpiotr
vpiotr / MyDesktopApp.nsi
Last active May 16, 2019 18:28
Sample NSIS script used in my desktop application
;--------------------------------------------------------------
;Sample NSIS script for MyDesktopApp
;
;Author: Piotr Likus, 2019
; https://github.com/vpiotr
;
;Initial script automatically created by Mihov NSIS Helper 3.2
; http://freeware.mihov.com
;
;Some patterns to be replaced:
@vpiotr
vpiotr / git-quickref.md
Last active November 8, 2022 23:06
Git Command Quickref

Configure

  • show config value

    git config --global user.name
    
  • edit all config values

    nano ~/.gitconfig
    
@vpiotr
vpiotr / svn-quickref.md
Created August 14, 2019 10:48
SVN Command Quickref

Basic commands

Add

  • add files

    svn add myscript.sh
    
  • add all which are not in SVN

Swagger QuickRef

Specification

Local Docker execution

Swagger Editor

Run Swagger Editor via Docker

Annotations

Spring Data - Document

  • @Document - specify collection
  • @Field - specify column (field) name
  • @Indexed - add field to index
  • @TextIndexed - full text index
  • @Transient - do not store
  • @DBRef - ref
  • @PersistentConstructor - use this constractor for deserialization