Skip to content

Instantly share code, notes, and snippets.

View Kcko's full-sized avatar
🦜
fly like a bird ...

Kcko

🦜
fly like a bird ...
View GitHub Profile
@Kcko
Kcko / kraje a mesta CR.csv
Created April 6, 2024 18:45 — forked from MichalKalita/kraje a mesta CR.csv
Kraje a města České Republiky, neobsahuje obce
id parent_id name
1 Hlavní město Praha
2 Jihočeský
3 Jihomoravský
4 Karlovarský
5 Královéhradecký
6 Liberecký
7 Moravskoslezský
8 Olomoucký
9 Pardubický
<template>
<div class="settings">
<div class="settings-row">
<ThemeSelector />
theme {{ theme }}
<div :class="selectedTheme">Here's how the {{ selectedTheme }} theme looks like.</div>
</div>
</div>
</template>
const data = [
{
id: 1,
user: 'Kcko',
gender: 'M'
},
{
id: 2,
user: 'Superman',
gender: 'M'
/*
https://medium.com/just-javascript-tutorials/javascript-union-intersection-and-difference-with-es6-set-13b953b21f62
*/
const setA = new Set(['🌞', '🌝', '🌎']);
const setB = new Set(['🌎', '🚀', '👩‍🚀']);
const union = new Set([...setA, ...setB]);
console.log(union); // Set(5) { '🌞', '🌝', '🌎', '🚀', '👩‍🚀' }
<?php
// https://forum.nette.org/cs/22304-zavislost-jednoho-modelu-na-jinych
/**
* @param Closure $callback
*/
private function doInTransaction(Closure $callback)
{
$this->isInTransaction = TRUE;
function getUserInfo() {
return new Promise((resolve, reject) => {
setTimeout(() => {
reject('request exception')
}, 1000)
})
}
// 1) Try-catch
@Kcko
Kcko / foo.js
Last active March 27, 2024 06:39
// ES 6, JS without bundlers
// 1) fetch('data.json').then().then() ...
// 2) import data from './data.json' assert { type: 'json' };
// Vue
async function fetchData() {
try {
const response = await import('@/data.json');
<template>
<p>{{ counterInfo.currentValue }} / {{ counterInfo.nextValue }}</p>
<button @click="pokus().a(50)">Pokus</button>
</template>
<script>
methods: {
pokus() {
return {
a: n => {
@Kcko
Kcko / App.vue
Last active March 25, 2024 08:32
<template>
<div id="app">
Data z rodiče: {{ msg }}
<hr />
<Formik v-model="msg" />
</div>
</template>
<script>
import Formik from './components/Formik.vue';
function heidiDecode(hex) {
var str = '';
var shift = parseInt(hex.substr(-1));
hex = hex.substr(0, hex.length - 1);
for (var i = 0; i < hex.length; i += 2)
str += String.fromCharCode(parseInt(hex.substr(i, 2), 16) - shift);
return str;
}
heidiDecode('pwd ...')