Saturday, September 19, 2020

Photoshop learning #1

Sunday, December 29, 2019

Markdown - po co to komu?



Co to jest?

Język pozwalający na formatowanie dokumentów tekstowych (plain text).

Po co to komu?

Żeby w prosty sposób (tzn. nie bawiąc się w znaczniki HTML czy inne dziwactwa) wygenerować przyzwoicie wyglądający dokument (np. HTML, PDF, itd.).

Jak to działa?

Tworzysz dokument o rozszerzeniu .md lub .markdown, gdzie wprowadzasz wymaganą treść wraz ze znacznikami Markdown. Następnie przepuszczasz wspomniany plik przez tzw. Markdown application (parser języka Markdown), w wyniku czego otrzymujesz np. dokument HTML sformatowany dokładnie tak jak chciałeś, ale dużo niższym nakładem pracy.

Do czego mogę tego użyć?

  • do stron internetowych
  • do tworzenia dokumentów tekstowych/notatek/e-maili

Czy ktoś jeszcze na świecie używa czegoś takiego?

Składnia

Nagłówki (<h1>-<h6>) - #..######

# To jest tag HTML <h1>
## A to jest tag HTML <h2>
### Dla odmiany to jest tag HTML <h3>
###### A to ostatni z tej serii tagów - <h6>

Paragrafy (<p>) - pusta linia

To jest pierwszy paragraf, pod którym jest linia z pustą spacją

To jest drugi paragraf.    

Przejście do nowej linii (<br>) - dwie lub więcej spacji + Enter

Jakiś tekst zakończony dwoma spacjami i enterem  
Jakiś inny tekst

Wytłuszczenie (<b>) - **text** lub __text__

A tutaj będzie **tekst wyboldowany**.
Zupełnie tak samo jak __tutaj__.

Kursywa (<i>) - *text* lub _text_

A tutaj będzie *tekst pochylony*.
Zupełnie tak samo jak _tutaj_.

Kursywa + wytłuszczenie

To jest ***sposób pierwszy***.
A tutaj ___sposób drugi___.
Ale uwaga - jest też __*sposób trzeci*__.
Doszukałem się też **_czwartego_**. 

Przekreślenie (<s>) - ~~text~~

Niniejszym wykreślam ~~cię~~!.

Cytat blokowy (<blockquote>) - >

Podszedł do pracownika i powiedział:
> Pracą swą hańbił zakładu tego nie będziesz!

Listy

Listy uporządkowane

Elementy listy uporządkowanej posiadają pewną numerację (cyfry lub litery).

1. Pierwszy element
2. Drugi element
3. Trzeci element
7. Czwarty element
10. Piąty element

1. Pierwszy element
1. Drugi element
1. Trzeci element
1. Czwarty element
1. Piąty element

Wynik powyższych kodów został pokazany poniżej. Wydać na nim, że niezależnie od indeksów wprowadzonych w kodzie elementy są numerowane od 1 do ilości elementów.

Listy nieuporządkowana

Elementy listy nieuporządkowanej nie są numerowane - są luźno wymienione domyślnie po krpkach. W Markdown do numerowania można użyć znaków: +,-,*.

- pierwszy element
* drugi element 
+ trzeci element 

Listy zagnieżdzone

1. Pierwszy element
2. Drugi element
    1. Drugi element - 1
    2. Drugi element -2 
3. Trzeci element

Obrazki

![Snoopy](snoopy.gif)

Kod (<code>) - ``

Funkcja `printf` jest bardzo szeroko wykorzystywana. 

Blok kodu (<pre><code>...</code></pre>) - 4 spacje lub tab

    <html>
        <head/>
    </html>

Linia pozioma (<hr>) - *** lub --- lub ___ (3 lub więcej)

***
Jakiś tekst
-----

Linki

Go to [SoftSystem web page](www.softsystem.pl).    

Tabele

Utworzenie tabeli

|Kol1 | Kol2|Kol3|
|---|---|---|
|Text 1|Text 2|Text 3|
|Text 4|Long text 5|T 6|

Wynik:

Kol1 Kol2 Kol3
Text 1 Text 2 Text 3
Text 4 Long text 5 T 6

Wyrównywanie :--, :--:, --:

|Kolumna 1 |Kolumna2 |Kolumna 3|
|:---|:---:|---:|
|Text 1|Text 2|Text 3|
|Text 4|Long text 5|T 6|
Kolumna 1 Kolumna2 Kolumna 3
Text 1 Text 2 Text 3
Text 4 Long text 5 T 6

Podświetlanie składni językowych

```json
{
 "employee" : "Waldek",
 "salary" : "15 000"
}
```

Saturday, December 21, 2019

Christmas time

Time to be back on this blog, but first let me introduce you one of my private Santas :)


New year is the time for changes. Now everyone likes changes. But there are some events which push you in some direction, no matter if in the current point of time it looks not to make a lot of sense.
Going further is not a simple way, but is the only possible way in some times.

Go beyond the comfort zone and change your life!  The best time for it is now!

Monday, December 8, 2014

Adding a watermark with date and time to photos

Based on http://dptnt.com/2009/08/add-date-time-stamp-to-jpeg-photos-using-free-software-mac-linux-nix-edition/ with some custom modification.


#!/bin/bash

if [ $# -eq 0 ]
   then
      cat << _EOF_

USAGE: $0 file1 file2 ..., or
       $0 *.jpg, or
       $0 dir/*.jpg
       ...

_EOF_
      exit
fi

while [ "$1" != "" ]; do
        # Skip directories
        if [ -d "$1" ]; then
                shift
                continue
        fi
        # Skip already converted files (may get overwritten)
        if [[ $1 == *_DT* ]]
        then
                echo "------  Skipping: $1"
                shift
                continue
        fi

        file=$1
        echo "######  Working on file: $file"
        filename=${file%.*}
        extension=${file##*.}
        output=${filename}_DT.${extension}

        # Get the file dimension
        dim=$(identify -format "%w %h" "$file")
        width=${dim%% *}
        height=${dim#* }

        # Decide the font size automatically
        if [ $width -ge $height ]
        then
                pointsize=$(($width/30))
        else
                pointsize=$(($height/30))
        fi

        echo "        Width: $width, Height: $height. Using pointsize: $pointsize"

        # The real deal here
        convert "$file" -gravity SouthEast -pointsize $pointsize -fill white -annotate +$pointsize+$pointsize "%[exif:DateTimeOriginal]" "$output"

        shift
done

exit 0

Friday, November 15, 2013

Batch renaming of files containing some character in theirs name

import glob
import os
os.chdir("C:\Users\waldekd\Desktop\PHOTOGRAPHY")
for files in glob.glob("*.*"):
    if not files.endswith("mp3"):
        index = files.find("@")
        if index > -1:
             print files[:index]
             os.rename(files, 'new'.join(files[:index]))

Wednesday, May 29, 2013

FCE preparations: simple story...

It was five o’clock in the morning when there was a knock at the door. I was sleeping soundly at the beginning I did not recognise the sound. Somebody knocked once again. This time I was sure that it was not a dream. I opened the door. I saw her. She was standing there and looking at me strangely. I saw blood on the boots...
It all began a few days ago. After the manager of my office had been found dead in his home I took over his responsibilities. During one of the our weekly meetings I came across her. She was the most beautiful girl I had ever seen. We started going out together and sometimes she stayed in my flat for night. It was like a dream, but one day she told  me that she had to go out of the city for some time. I wanted to know why she needed to do it but she denied replying to my question whispering “It doesn’t matter”.   
The next evening I got a phone call. It was my friend who told me that a woman had killed Norman, the boss of the NeoComp, but the police were not able to catch her. We agreed to arrange the meeting the next day as NeoComp was one of our main suppliers. After that I went to bed.
It was five o’clock in the morning when there was a knock at the door...

Search This Blog