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
| const axiosconfig = { | |
| baseurl: 'https://site.com/api/', | |
| timeout: 30000, | |
| }; | |
| import Vue from 'vue'; | |
| import axios from 'axios'; | |
| // Setting up Axios on Vue Instance, for use via this.$axios | |
| Vue.prototype.$axios = axios.create(axiosConfig); |
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
| function *fibonacci(n) { | |
| const infinite = !n && n !== 0; | |
| let current = 0; | |
| let next = 1; | |
| while (infinite || n--) { | |
| yield current; | |
| [current, next] = [next, current + next]; | |
| } | |
| } |
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
| Example code for exporting data in a table to a csv file. |
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
| <?php | |
| /** | |
| * Transforms an under_scored_string to a camelCasedOne | |
| */ | |
| function camelize($scored) { | |
| return lcfirst( | |
| implode( | |
| '', | |
| array_map( |