A Pen by Sebastian Rothbucher on CodePen.
This file contains hidden or 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
| find . -name '00000*.json' | xargs gsed -i 's/"partitionBy":\[\]/"partitionBy":"\[\]"/g' |
This file contains hidden or 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
| library(lime) | |
| library(datasets) | |
| library(nnet) | |
| library(caret) | |
| #View(iris) | |
| train_index <- sample(1:nrow(iris), 0.8 * nrow(iris)) | |
| test_index <- setdiff(1:nrow(iris), train_index) | |
| iris_net <- nnet(Species~., data = iris[train_index,], size = 20) | |
| test_pred <- predict(iris_net, iris[test_index, c(1:4)], type = 'class') | |
| test_conf <- confusionMatrix(factor(test_pred), iris$Species[test_index], mode = 'prec_recall') |
This file contains hidden or 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
| <button onclick="clck()">click me!</button> |
This file contains hidden or 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
| // Step 1: Create a Vue instance | |
| const Vue = require('../vue/dist/vue.runtime.common.dev'); | |
| const app = require('./vue/app'); | |
| // Step 2: Create a renderer | |
| const rendererFactory = require('../vue/packages/vue-server-renderer/build.dev'); | |
| const renderer=rendererFactory.createRenderer(); | |
| // Step 3a: Render the Vue instance to HTML | |
| let renderedHtml = null; |
This file contains hidden or 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
| <div id="rootDiv"> | |
| <div v-if="!loaded">Content from Server</div> | |
| <test-comp v-if="loaded"></test-comp><!-- do NOT shorthand, vue does swallow the rest of rootDiv then --> | |
| <test-bt><button>from Server</button></test-bt> | |
| <div v-text="vueText">Text from Server</div> | |
| </div> | |
| <br /><br /> | |
| <button onclick="igniteVue()">Go, vue!</button> (normally on load) |
This file contains hidden or 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
| <html> | |
| <body> | |
| <script> | |
| function doMagic() { | |
| event.preventDefault(); | |
| fetch('page2.json').then(res => res.json()).then(res => { | |
| Object.keys(res).forEach(k => document.getElementById(k).textContent=res[k]); | |
| history.pushState({}, null, "page2.html"); | |
| }); | |
| } |
This file contains hidden or 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
| 950c950,951 | |
| < return $html; | |
| --- | |
| > $isNoJsOnly = preg_match('/^\\s*$/', $html) || preg_match('/^\\s*</', $html); | |
| > return $isNoJsOnly ? '<!-- Start ' . $this->getNameInLayout() .' (' . (property_exists($this, '_template') ? ($this->_template . ' ') : '') . '-->' . $html . '<!-- End ' . $this->getNameInLayout() . ' -->' : $html; |
This file contains hidden or 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
| // "isomorphic-fetch": "^2.2.1", | |
| // "vue": "^2.6.10", | |
| // "vue-server-renderer": "^2.6.10" | |
| require('isomorphic-fetch'); | |
| // Step 1: Create a Vue instance | |
| const Vue = require('vue') | |
| Vue.component('my-component', { | |
| template: `<div>Hello World {{msg}}</div>`, |