Skip to content

Instantly share code, notes, and snippets.

@novotnyr
novotnyr / redis-session.sh
Created November 29, 2016 14:19
redis-cli utility to handle Spring Security / Spring Session sessions
#!/bin/sh
COMMAND="$1"
REDIS_CLI="redis-cli"
case "$COMMAND" in
list)
"$REDIS_CLI" keys 'spring:session:sessions:[a-f0-9][a-f0-9]*'
;;
hkeys)
@novotnyr
novotnyr / keltska_krcma_slack.sh
Last active July 30, 2017 18:41
Downloads a lunch menu from KeltskaKrcma.sk and pipes it to the Slack webhook.
#!/bin/sh
SLACK_HOOK=___FILL_IN____
curl -s http://keltskakrcma.sk/index.php \
| hxnormalize -x \
| hxunent \
| hxselect -i "#left_galeria table:nth-child(11)" \
| hxnormalize -x -i 2 -l 99999 \
| xmlstarlet sel -t -v "//tr[position() > 1]/td//text()" \
| grep -ve '^\s*$' \
1995-08-24 Windows 95 [Chicago] #win
1998-06-25 Windows 98 [Memphis] #win
2000-02-17 Windows 2000 [NT 5.0] #win-nt
2000-09-14 Windows ME [Millenium] #win
2001-10-25 Windows XP [Whistler] #win #win-nt
2003-04-24 Windows Server 2003 [Whistler Server] #win #win-nt #server
2006-11-30 Windows Vista [Whistler] #win #win-nt
2008-02-27 Windows Server 2008 [Longhorn Server] #win #win-nt #server
2009-10-22 Windows 7 [Vienna] #win #win-nt
2009-10-22 Windows Server 2008 R2 [Longhorn Server] #win #win-nt #server

Zalozenie

hugo new site .

Zalozenie noveho clanku

hugo new content/index.md

Clanky su:

First Time Setup

  1. Run CLion
  2. Set Do not import settings, as there is nothing to import yet.
  3. Setup Light/Dark theme
  4. For the sake of simplicity, disable all plugins.
  5. Do not enable any featured plugins.
  6. Start using CLion.
  7. Toggle Evaluate for free for 30 days.
package com.github.novotnyr.rc;
import java.text.ParseException;
import java.time.DateTimeException;
import java.time.LocalDate;
public class RodneCislo {
private LocalDate datum;
private String koncovka;
Ferdinand I., 1526 - 1564
Maximilián, 1564 - 1576
Rudolf, 1576 - 1608
Matej II., 1608 - 1619
Ferdinand II., 1619 - 1637
Gabriel Betlen, 1619 - 1621
Ferdinand III., 1637 - 1657
Leopold I., 1657 - 1705
Imrich Tököli, 1682 - 1685
Jozef I., 1705 - 1711
Ferdinand I., 1526 - 1564
Maximilián, 1564 - 1576
Rudolf, 1576 - 1608
Matej II., 1608 - 1619
Ferdinand II., 1619 - 1637
Gabriel Betlen, 1619 - 1621
Ferdinand III., 1637 - 1657
Leopold I., 1657 - 1705
Imrich Tököli, 1682 - 1685
Jozef I., 1705 - 1711
package com.github.novotnyr.yello
import android.content.Context
import androidx.room.Database
import androidx.room.Room
import androidx.room.RoomDatabase
@Database(entities = [Note::class], version = 1)
abstract class AppDatabase : RoomDatabase() {
@novotnyr
novotnyr / gist:9e1fade9406d10cf729356bfd5d0c603
Last active March 22, 2021 07:45
UINF/VMA Android 2021 - Appka Presentr
implementation 'androidx.activity:activity-ktx:1.2.1'
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
implementation 'com.google.code.gson:gson:2.8.6'
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
------------
REST API:
https://ics.upjs.sk/~novotnyr/android/demo/presentr/index.php/available-users