This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script setup> | |
import { ref, watch, toRefs } from 'vue' | |
const props = defineProps({ | |
test: String | |
}) | |
let refTest = ref(props.test) | |
const { test: testToRefs } = toRefs(props) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Parent --> | |
<template> | |
<CommonInput v-model="inputValue" /> | |
</template> | |
<script setup lang="ts"> | |
import { ref } from "vue"; | |
const inputValue = ref(); | |
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}`); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* | |
* Array 2 XML class | |
* Convert an array or multi-dimentional array to XML | |
* | |
* @author Kevin Waterson | |
* @copyright 2009 PHPRO.ORG |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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ý |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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> | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const data = [ | |
{ | |
id: 1, | |
user: 'Kcko', | |
gender: 'M' | |
}, | |
{ | |
id: 2, | |
user: 'Superman', | |
gender: 'M' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
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) { '🌞', '🌝', '🌎', '🚀', '👩🚀' } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// https://forum.nette.org/cs/22304-zavislost-jednoho-modelu-na-jinych | |
/** | |
* @param Closure $callback | |
*/ | |
private function doInTransaction(Closure $callback) | |
{ | |
$this->isInTransaction = TRUE; |
NewerOlder