Skip to content

Instantly share code, notes, and snippets.

View DavidKloucek's full-sized avatar

David Klouček DavidKloucek

View GitHub Profile
# http://www.gaia-gis.it/gaia-sins/spatialite-sql-latest.html
# http://www.gaia-gis.it/gaia-sins/spatialite-cookbook/index.html
# $em->getConnection()->getNativeConnection()->loadExtension('mod_spatialite.dylib');
CREATE TABLE IF NOT EXISTS city (
id integer primary key AUTOINCREMENT unique not null,
name text not null
);
// youtube.com/watch?v=wM6o70NAWUI
fn read_file(fnm: &str) -> Result<String, io::Error> {
let mut s = String::new();
File::open(fnm)?.read_to_string(&mut s)?;
return Ok(s);
}
fn read_file_longer_version(fnm: &str) -> Result<String, io::Error> {
let f = File::open(fnm);
@DavidKloucek
DavidKloucek / no-identity-map.php
Last active June 25, 2023 14:39
Laravel Eloquent problem
<?php
public function testIdentityMap()
{
Comment::query()->where(['id' => 1])->update(['content' => 'a']); // set default value for the first comment
$user = User::query()->find(1);
$user->name = 'David '.date('s');
$user->save();
$user2 = User::query()->find(1);
unique - juːˈniːk
nullable - ˈnʌləbl
result - rɪˈzʌlt
event -ɪˈvent
query - ˈkwɪərɪ
key - kiː
partial - ˈpɑːʃəl
talk - tɔːk
walk - wɔːk
defer - dɪˈfɜː
@DavidKloucek
DavidKloucek / gist:b79e4d17b6061b5b1fba2a4d93c266bd
Last active June 24, 2023 21:07
Nejužitečnější přednášky - Vývoj
OOP architektura e-shopu
https://docs.sylius.com/en/latest/
https://docs.shopsys.com/en/latest/
Filip Procházka – Evolving architecture
https://www.youtube.com/watch?v=ZDQPZixsCXM
Jak se NEZBLÁZNIT Z LEGACY APLIKACÍ - Filip Procházka
https://www.youtube.com/watch?v=FEXsKFOrgQo
import { useCallback, useEffect, useState, useRef, Fragment} from 'react';
import React from 'react';
import Select from 'react-select';
const defaultData = {
type: 'GroupControl',
data: {
operator: 'plus',
},
children: [
https://www.alza.cz/porovnani.htm?c=ND510f70;ND510m50;NT047h45;NT047h49;NT047h60;NT088k40;NT088h2f;NT044s2;NT044s8;NT086x1i;NT044u2;NT086s1;
https://www.czc.cz/samsung-s24f350-led-monitor-24/194681/produkt
https://www.czc.cz/aoc-24v2q-led-monitor-23-8/247331/produkt
ac1557a5faf0a11685fc9ae201697a9ca59454a8
#! python3
import os, re
from datetime import datetime
from PIL import Image
SOURCE_DIR = 'C:/Users/David/Desktop/smicka/'
FINAL_PATH = 'C:/Users/David/Desktop/smicka.png'
pattern = re.compile('^[0-9]+\.(png|jpg|jpeg)$')
files = []