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
<script setup>
import { ref, watch, toRefs } from 'vue'
const props = defineProps({
test: String
})
let refTest = ref(props.test)
const { test: testToRefs } = toRefs(props)
<!-- Parent -->
<template>
<CommonInput v-model="inputValue" />
</template>
<script setup lang="ts">
import { ref } from "vue";
const inputValue = ref();
</script>
// JS
function setPreferences({ theme = 'dark', layout = 'grid' } = {}) {
console.log(`Preferences set: Theme - ${theme}, Layout - ${layout}`);
}
export function useRefHistory(ref, options) {
const {
deep = false,
capacity = Infinity,
} = options;
outerLoop: for (let i = 0; i < 5; i++) {
innerLoop: for (let j = 0; j < 5; j++) {
if (i === 2 && j === 2) break outerLoop;
console.log(`i=${i}, j=${j}`);
}
}
<?php
/**
*
* Array 2 XML class
* Convert an array or multi-dimentional array to XML
*
* @author Kevin Waterson
* @copyright 2009 PHPRO.ORG
@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;